#include "dsst.h"
#include<opencv2/core.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/opencv.hpp>
//#include<opencv2/opencv.hpp>
//#include <opencv2/highgui/highgui.hpp>
//#include "cv.h"
//#include "highgui.h"
//#include <opencv2/opencv.hpp>
//#include "opencv2/video/tracking.hpp"
//#include "opencv2/imgproc/imgproc.hpp"
#include<malloc.h>  
//#include<ctime>
#include<math.h>  
//#include<stdio.h>
#include <iostream>
//#include <fstream>
//#include <string>
//#include <iostream>
//#include <ctype.h>
//using namespace std;
using namespace cv;

//滤波器
//尺度因子滤波器 --- 增强边沿特征
short ysf[17] = { 21818,20199,16027,10900,6354,3175,1361,509,199,199,509,1361,3175,6354,10900,16027,20199 };
//余弦窗滤波器 --- 增强中间特征
unsigned short cos_window[16 * 16] = {
	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	,0,15,59,122,196,266,320,350,350,320,266,196,122,59,15,0
	,0,59,224,468,748,1016,1226,1340,1340,1226,1016,748,468,224,59,0
	,0,122,468,978,1563,2123,2560,2799,2799,2560,2123,1563,978,468,122,0
	,0,196,748,1563,2499,3393,4092,4475,4475,4092,3393,2499,1563,748,196,0
	,0,266,1016,2123,3393,4608,5557,6077,6077,5557,4608,3393,2123,1016,266,0
	,0,320,1226,2560,4092,5557,6702,7329,7329,6702,5557,4092,2560,1226,320,0
	,0,350,1340,2799,4475,6077,7329,8014,8014,7329,6077,4475,2799,1340,350,0
	,0,350,1340,2799,4475,6077,7329,8014,8014,7329,6077,4475,2799,1340,350,0
	,0,320,1226,2560,4092,5557,6702,7329,7329,6702,5557,4092,2560,1226,320,0
	,0,266,1016,2123,3393,4608,5557,6077,6077,5557,4608,3393,2123,1016,266,0
	,0,196,748,1563,2499,3393,4092,4475,4475,4092,3393,2499,1563,748,196,0
	,0,122,468,978,1563,2123,2560,2799,2799,2560,2123,1563,978,468,122,0
	,0,59,224,468,748,1016,1226,1340,1340,1226,1016,748,468,224,59,0
	,0,15,59,122,196,266,320,350,350,320,266,196,122,59,15,0
	,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
//余弦窗滤波器 --- 增强边沿特征
unsigned short yf[16 * 16] =//*8192
{ 13241,13024,12408,11489,10408,9331,8422,7815,7603,7815,8422,9331,10408,11489,12408,13024,
13024,12811,12205,11301,10238,9178,8284,7688,7478,7688,8284,9178,10238,11301,12205,12811,
12408,12205,11628,10766,9753,8744,7892,7324,7125,7324,7892,8744,9753,10766,11628,12205,
11489,11301,10766,9968,9031,8096,7307,6781,6597,6781,7307,8096,9031,9968,10766,11301,
10408,10238,9753,9031,8181,7335,6620,6143,5976,6143,6620,7335,8181,9031,9753,10238,
9331,9178,8744,8096,7335,6576,5935,5508,5358,5508,5935,6576,7335,8096,8744,9178,
8422,8284,7892,7307,6620,5935,5356,4971,4836,4971,5356,5935,6620,7307,7892,8284,
7815,7688,7324,6781,6143,5508,4971,4613,4488,4613,4971,5508,6143,6781,7324,7688,
7603,7478,7125,6597,5976,5358,4836,4488,4366,4488,4836,5358,5976,6597,7125,7478,
7815,7688,7324,6781,6143,5508,4971,4613,4488,4613,4971,5508,6143,6781,7324,7688,
8422,8284,7892,7307,6620,5935,5356,4971,4836,4971,5356,5935,6620,7307,7892,8284,
9331,9178,8744,8096,7335,6576,5935,5508,5358,5508,5935,6576,7335,8096,8744,9178,
10408,10238,9753,9031,8181,7335,6620,6143,5976,6143,6620,7335,8181,9031,9753,10238,
11489,11301,10766,9968,9031,8096,7307,6781,6597,6781,7307,8096,9031,9968,10766,11301,
12408,12205,11628,10766,9753,8744,7892,7324,7125,7324,7892,8744,9753,10766,11628,12205,
13024,12811,12205,11301,10238,9178,8284,7688,7478,7688,8284,9178,10238,11301,12205,12811 };
//unsigned short acostable[100];
//余弦值的查找表，
//余弦值的计算是非常繁琐的，在计算相关滤波器时候，需要计算每个像素点与末班的差异值乘以余弦函数的值，因此为了提高计算的效率，来把值储存起来，无需每次都计算，加快计算速度
unsigned short acostable[20020] =
{51472,51472,51472,51472,51472,51472,51472,51472,51472,51472,51472,51240,51144,51071,51008,50954,50904,50859,50816,50777,50739,50703,50669,50636,50605,50574,50545,50516,50489,50462,50435,50410,50385,50360,50337,50313,50290,50268,50246,50224,50202,50181,50161,50140,50120,50101,50081,50062,50043,50024,50006,49988,49970,49952,49934,49917,49900,49883,49866,49849,49833,49816,49800,49784,49768,49753,49737,49722,49706,49691,49676,49661,49646,49632,49617,49603,49588,49574,49560,49546,49532,49518,49505,49491,49477,49464,49451,49437,49424,49411,49398,49385,49372,49359,49347,49334,49322,49309,49297,49284,49272,49260,49248,49236,49224,49212,49200,49188,49176,49165,49153,49141,49130,49118,49107,49096,49084,49073,49062,49051,49039,49028,49017,49006,48996,48985,48974,48963,48952,48942,48931,48921,48910,48899,48889,48879,48868,48858,48848,48837,48827,48817,48807,48797,48787,48777,48767,48757,48747,48737,48727,48717,48707,48698,48688,48678,48669,48659,48650,48640,48631,48621,48612,48602,48593,48583,48574,48565,48556,48546,48537,48528,48519,48510,48501,48491,48482,48473,48464,48455,48446,48438,48429,48420,48411,48402,48393,48385,48376,48367,48359,48350,48341,48333,48324,48315,48307,48298,48290,48281,48273,48265,48256,48248,48239,48231,48223,48214,48206,48198,48190,48181,48173,48165,48157,48149,48141,48132,48124,48116,48108,48100,48092,48084,48076,48068,48060,48052,48045,48037,48029,48021,48013,48005,47998,47990,47982,47974,47967,47959,47951,47943,47936,47928,47921,47913,47905,47898,47890,47883,47875,47868,47860,47853,47845,47838,47830,47823,47815,47808,47801,47793,47786,47779,47771,47764,47757,47749,47742,47735,47728,47720,47713,47706,47699,47692,47684,47677,47670,47663,47656,47649,47642,47635,47628,47621,47614,47607,47600,47593,47586,47579,47572,47565,47558,47551,47544,47537,47530,47523,47516,47510,47503,47496,47489,47482,47476,47469,47462,47455,47449,47442,47435,47428,47422,47415,47408,47402,47395,47388,47382,47375,47368,47362,47355,47349,47342,47335,47329,47322,47316,47309,47303,47296,47290,47283,47277,47270,47264,47258,47251,47245,47238,47232,47225,47219,47213,47206,47200,47194,47187,47181,47175,47168,47162,47156,47149,47143,47137,47131,47124,47118,47112,47106,47099,47093,47087,47081,47075,47068,47062,47056,47050,47044,47038,47032,47025,47019,47013,47007,47001,46995,46989,46983,46977,46971,46965,46959,46953,46947,46941,46935,46929,46923,46917,46911,46905,46899,46893,46887,46881,46875,46869,46863,46857,46852,46846,46840,46834,46828,46822,46816,46810,46805,46799,46793,46787,46781,46776,46770,46764,46758,46752,46747,46741,46735,46729,46724,46718,46712,46707,46701,46695,46689,46684,46678,46672,46667,46661,46655,46650,46644,46638,46633,46627,46622,46616,46610,46605,46599,46594,46588,46582,46577,46571,46566,46560,46555,46549,46544,46538,46533,46527,46521,46516,46510,46505,46500,46494,46489,46483,46478,46472,46467,46461,46456,46450,46445,46440,46434,46429,46423,46418,46413,46407,46402,46396,46391,46386,46380,46375,46370,46364,46359,46354,46348,46343,46338,46332,46327,46322,46316,46311,46306,46301,46295,46290,46285,46279,46274,46269,46264,46258,46253,46248,46243,46238,46232,46227,46222,46217,46212,46206,46201,46196,46191,46186,46180,46175,46170,46165,46160,46155,46150,46144,46139,46134,46129,46124,46119,46114,46109,46104,46098,46093,46088,46083,46078,46073,46068,46063,46058,46053,46048,46043,46038,46033,46028,46023,46018,46013,46008,46003,45998,45993,45988,45983,45978,45973,45968,45963,45958,45953,45948,45943,45938,45933,45928,45923,45918,45913,45908,45904,45899,45894,45889,45884,45879,45874,45869,45864,45859,45855,45850,45845,45840,45835,45830,45825,45821,45816,45811,45806,45801,45796,45792,45787,45782,45777,45772,45768,45763,45758,45753,45748,45744,45739,45734,45729,45724,45720,45715,45710,45705,45701,45696,45691,45686,45682,45677,45672,45667,45663,45658,45653,45649,45644,45639,45635,45630,45625,45620,45616,45611,45606,45602,45597,45592,45588,45583,45578,45574,45569,45564,45560,45555,45551,45546,45541,45537,45532,45527,45523,45518,45514,45509,45504,45500,45495,45491,45486,45481,45477,45472,45468,45463,45459,45454,45449,45445,45440,45436,45431,45427,45422,45418,45413,45409,45404,45399,45395,45390,45386,45381,45377,45372,45368,45363,45359,45354,45350,45345,45341,45336,45332,45328,45323,45319,45314,45310,45305,45301,45296,45292,45287,45283,45278,45274,45270,45265,45261,45256,45252,45247,45243,45239,45234,45230,45225,45221,45217,45212,45208,45203,45199,45195,45190,45186,45182,45177,45173,45168,45164,45160,45155,45151,45147,45142,45138,45134,45129,45125,45121,45116,45112,45108,45103,45099,45095,45090,45086,45082,45077,45073,45069,45064,45060,45056,45052,45047,45043,45039,45034,45030,45026,45022,45017,45013,45009,45005,45000,44996,44992,44988,44983,44979,44975,44971,44966,44962,44958,44954,44949,44945,44941,44937,44933,44928,44924,44920,44916,44911,44907,44903,44899,44895,44891,44886,44882,44878,44874,44870,44865,44861,44857,44853,44849,44845,44840,44836,44832,44828,44824,44820,44815,44811,44807,44803,44799,44795,44791,44787,44782,44778,44774,44770,44766,44762,44758,44754,44749,44745,44741,44737,44733,44729,44725,44721,44717,44713,44708,44704,44700,44696,44692,44688,44684,44680,44676,44672,44668,44664,44660,44656,44652,44647,44643,44639,44635,44631,44627,44623,44619,44615,44611,44607,44603,44599,44595,44591,44587,44583,44579,44575,44571,44567,44563,44559,44555,44551,44547,44543,44539,44535,44531,44527,44523,44519,44515,44511,44507,44503,44499,44495,44491,44487,44483,44479,44475,44471,44467,44464,44460,44456,44452,44448,44444,44440,44436,44432,44428,44424,44420,44416,44412,44408,44405,44401,44397,44393,44389,44385,44381,44377,44373,44369,44365,44362,44358,44354,44350,44346,44342,44338,44334,44330,44327,44323,44319,44315,44311,44307,44303,44299,44296,44292,44288,44284,44280,44276,44272,44269,44265,44261,44257,44253,44249,44246,44242,44238,44234,44230,44226,44223,44219,44215,44211,44207,44203,44200,44196,44192,44188,44184,44181,44177,44173,44169,44165,44162,44158,44154,44150,44146,44143,44139,44135,44131,44127,44124,44120,44116,44112,44109,44105,44101,44097,44094,44090,44086,44082,44078,44075,44071,44067,44063,44060,44056,44052,44048,44045,44041,44037,44034,44030,44026,44022,44019,44015,44011,44007,44004,44000,43996,43993,43989,43985,43981,43978,43974,43970,43967,43963,43959,43955,43952,43948,43944,43941,43937,43933,43930,43926,43922,43919,43915,43911,43907,43904,43900,43896,43893,43889,43885,43882,43878,43874,43871,43867,43863,43860,43856,43853,43849,43845,43842,43838,43834,43831,43827,43823,43820,43816,43812,43809,43805,43802,43798,43794,43791,43787,43783,43780,43776,43773,43769,43765,43762,43758,43754,43751,43747,43744,43740,43736,43733,43729,43726,43722,43718,43715,43711,43708,43704,43700,43697,43693,43690,43686,43683,43679,43675,43672,43668,43665,43661,43658,43654,43650,43647,43643,43640,43636,43633,43629,43625,43622,43618,43615,43611,43608,43604,43601,43597,43594,43590,43586,43583,43579,43576,43572,43569,43565,43562,43558,43555,43551,43548,43544,43541,43537,43534,43530,43526,43523,43519,43516,43512,43509,43505,43502,43498,43495,43491,43488,43484,43481,43477,43474,43470,43467,43463,43460,43456,43453,43450,43446,43443,43439,43436,43432,43429,43425,43422,43418,43415,43411,43408,43404,43401,43397,43394,43390,43387,43384,43380,43377,43373,43370,43366,43363,43359,43356,43353,43349,43346,43342,43339,43335,43332,43328,43325,43322,43318,43315,43311,43308,43304,43301,43298,43294,43291,43287,43284,43280,43277,43274,43270,43267,43263,43260,43257,43253,43250,43246,43243,43240,43236,43233,43229,43226,43223,43219,43216,43212,43209,43206,43202,43199,43195,43192,43189,43185,43182,43179,43175,43172,43168,43165,43162,43158,43155,43152,43148,43145,43141,43138,43135,43131,43128,43125,43121,43118,43115,43111,43108,43104,43101,43098,43094,43091,43088,43084,43081,43078,43074,43071,43068,43064,43061,43058,43054,43051,43048,43044,43041,43038,43034,43031,43028,43024,43021,43018,43014,43011,43008,43004,43001,42998,42995,42991,42988,42985,42981,42978,42975,42971,42968,42965,42961,42958,42955,42952,42948,42945,42942,42938,42935,42932,42928,42925,42922,42919,42915,42912,42909,42905,42902,42899,42896,42892,42889,42886,42883,42879,42876,42873,42869,42866,42863,42860,42856,42853,42850,42847,42843,42840,42837,42834,42830,42827,42824,42821,42817,42814,42811,42808,42804,42801,42798,42795,42791,42788,42785,42782,42778,42775,42772,42769,42765,42762,42759,42756,42753,42749,42746,42743,42740,42736,42733,42730,42727,42724,42720,42717,42714,42711,42707,42704,42701,42698,42695,42691,42688,42685,42682,42679,42675,42672,42669,42666,42663,42659,42656,42653,42650,42647,42643,42640,42637,42634,42631,42627,42624,42621,42618,42615,42611,42608,42605,42602,42599,42596,42592,42589,42586,42583,42580,42577,42573,42570,42567,42564,42561,42558,42554,42551,42548,42545,42542,42539,42535,42532,42529,42526,42523,42520,42516,42513,42510,42507,42504,42501,42498,42494,42491,42488,42485,42482,42479,42476,42472,42469,42466,42463,42460,42457,42454,42450,42447,42444,42441,42438,42435,42432,42429,42425,42422,42419,42416,42413,42410,42407,42404,42401,42397,42394,42391,42388,42385,42382,42379,42376,42373,42369,42366,42363,42360,42357,42354,42351,42348,42345,42341,42338,42335,42332,42329,42326,42323,42320,42317,42314,42311,42307,42304,42301,42298,42295,42292,42289,42286,42283,42280,42277,42274,42270,42267,42264,42261,42258,42255,42252,42249,42246,42243,42240,42237,42234,42231,42227,42224,42221,42218,42215,42212,42209,42206,42203,42200,42197,42194,42191,42188,42185,42182,42179,42176,42172,42169,42166,42163,42160,42157,42154,42151,42148,42145,42142,42139,42136,42133,42130,42127,42124,42121,42118,42115,42112,42109,42106,42103,42100,42097,42094,42091,42088,42084,42081,42078,42075,42072,42069,42066,42063,42060,42057,42054,42051,42048,42045,42042,42039,42036,42033,42030,42027,42024,42021,42018,42015,42012,42009,42006,42003,42000,41997,41994,41991,41988,41985,41982,41979,41976,41973,41970,41967,41964,41961,41958,41955,41952,41949,41946,41943,41940,41937,41934,41931,41928,41925,41923,41920,41917,41914,41911,41908,41905,41902,41899,41896,41893,41890,41887,41884,41881,41878,41875,41872,41869,41866,41863,41860,41857,41854,41851,41848,41845,41842,41839,41837,41834,41831,41828,41825,41822,41819,41816,41813,41810,41807,41804,41801,41798,41795,41792,41789,41786,41784,41781,41778,41775,41772,41769,41766,41763,41760,41757,41754,41751,41748,41745,41742,41740,41737,41734,41731,41728,41725,41722,41719,41716,41713,41710,41707,41704,41702,41699,41696,41693,41690,41687,41684,41681,41678,41675,41672,41669,41667,41664,41661,41658,41655,41652,41649,41646,41643,41640,41638,41635,41632,41629,41626,41623,41620,41617,41614,41611,41609,41606,41603,41600,41597,41594,41591,41588,41585,41583,41580,41577,41574,41571,41568,41565,41562,41559,41557,41554,41551,41548,41545,41542,41539,41536,41534,41531,41528,41525,41522,41519,41516,41513,41511,41508,41505,41502,41499,41496,41493,41491,41488,41485,41482,41479,41476,41473,41471,41468,41465,41462,41459,41456,41453,41451,41448,41445,41442,41439,41436,41433,41431,41428,41425,41422,41419,41416,41414,41411,41408,41405,41402,41399,41396,41394,41391,41388,41385,41382,41379,41377,41374,41371,41368,41365,41362,41360,41357,41354,41351,41348,41345,41343,41340,41337,41334,41331,41328,41326,41323,41320,41317,41314,41312,41309,41306,41303,41300,41297,41295,41292,41289,41286,41283,41281,41278,41275,41272,41269,41267,41264,41261,41258,41255,41253,41250,41247,41244,41241,41238,41236,41233,41230,41227,41224,41222,41219,41216,41213,41211,41208,41205,41202,41199,41197,41194,41191,41188,41185,41183,41180,41177,41174,41171,41169,41166,41163,41160,41158,41155,41152,41149,41146,41144,41141,41138,41135,41132,41130,41127,41124,41121,41119,41116,41113,41110,41108,41105,41102,41099,41096,41094,41091,41088,41085,41083,41080,41077,41074,41072,41069,41066,41063,41061,41058,41055,41052,41049,41047,41044,41041,41038,41036,41033,41030,41027,41025,41022,41019,41016,41014,41011,41008,41005,41003,41000,40997,40994,40992,40989,40986,40983,40981,40978,40975,40973,40970,40967,40964,40962,40959,40956,40953,40951,40948,40945,40942,40940,40937,40934,40931,40929,40926,40923,40921,40918,40915,40912,40910,40907,40904,40901,40899,40896,40893,40891,40888,40885,40882,40880,40877,40874,40872,40869,40866,40863,40861,40858,40855,40853,40850,40847,40844,40842,40839,40836,40834,40831,40828,40825,40823,40820,40817,40815,40812,40809,40806,40804,40801,40798,40796,40793,40790,40788,40785,40782,40779,40777,40774,40771,40769,40766,40763,40761,40758,40755,40753,40750,40747,40744,40742,40739,40736,40734,40731,40728,40726,40723,40720,40718,40715,40712,40709,40707,40704,40701,40699,40696,40693,40691,40688,40685,40683,40680,40677,40675,40672,40669,40667,40664,40661,40659,40656,40653,40651,40648,40645,40643,40640,40637,40635,40632,40629,40627,40624,40621,40619,40616,40613,40611,40608,40605,40603,40600,40597,40595,40592,40589,40587,40584,40581,40579,40576,40573,40571,40568,40565,40563,40560,40557,40555,40552,40550,40547,40544,40542,40539,40536,40534,40531,40528,40526,40523,40520,40518,40515,40512,40510,40507,40505,40502,40499,40497,40494,40491,40489,40486,40483,40481,40478,40476,40473,40470,40468,40465,40462,40460,40457,40454,40452,40449,40447,40444,40441,40439,40436,40433,40431,40428,40426,40423,40420,40418,40415,40412,40410,40407,40405,40402,40399,40397,40394,40392,40389,40386,40384,40381,40378,40376,40373,40371,40368,40365,40363,40360,40358,40355,40352,40350,40347,40344,40342,40339,40337,40334,40331,40329,40326,40324,40321,40318,40316,40313,40311,40308,40305,40303,40300,40298,40295,40292,40290,40287,40285,40282,40279,40277,40274,40272,40269,40266,40264,40261,40259,40256,40254,40251,40248,40246,40243,40241,40238,40235,40233,40230,40228,40225,40222,40220,40217,40215,40212,40210,40207,40204,40202,40199,40197,40194,40191,40189,40186,40184,40181,40179,40176,40173,40171,40168,40166,40163,40161,40158,40155,40153,40150,40148,40145,40143,40140,40137,40135,40132,40130,40127,40125,40122,40119,40117,40114,40112,40109,40107,40104,40102,40099,40096,40094,40091,40089,40086,40084,40081,40078,40076,40073,40071,40068,40066,40063,40061,40058,40055,40053,40050,40048,40045,40043,40040,40038,40035,40033,40030,40027,40025,40022,40020,40017,40015,40012,40010,40007,40005,40002,39999,39997,39994,39992,39989,39987,39984,39982,39979,39977,39974,39972,39969,39966,39964,39961,39959,39956,39954,39951,39949,39946,39944,39941,39939,39936,39933,39931,39928,39926,39923,39921,39918,39916,39913,39911,39908,39906,39903,39901,39898,39896,39893,39891,39888,39885,39883,39880,39878,39875,39873,39870,39868,39865,39863,39860,39858,39855,39853,39850,39848,39845,39843,39840,39838,39835,39833,39830,39828,39825,39823,39820,39818,39815,39813,39810,39808,39805,39803,39800,39798,39795,39792,39790,39787,39785,39782,39780,39777,39775,39772,39770,39767,39765,39762,39760,39757,39755,39752,39750,39747,39745,39742,39740,39737,39735,39732,39730,39728,39725,39723,39720,39718,39715,39713,39710,39708,39705,39703,39700,39698,39695,39693,39690,39688,39685,39683,39680,39678,39675,39673,39670,39668,39665,39663,39660,39658,39655,39653,39650,39648,39645,39643,39640,39638,39636,39633,39631,39628,39626,39623,39621,39618,39616,39613,39611,39608,39606,39603,39601,39598,39596,39593,39591,39589,39586,39584,39581,39579,39576,39574,39571,39569,39566,39564,39561,39559,39556,39554,39552,39549,39547,39544,39542,39539,39537,39534,39532,39529,39527,39524,39522,39520,39517,39515,39512,39510,39507,39505,39502,39500,39497,39495,39493,39490,39488,39485,39483,39480,39478,39475,39473,39470,39468,39466,39463,39461,39458,39456,39453,39451,39448,39446,39444,39441,39439,39436,39434,39431,39429,39426,39424,39422,39419,39417,39414,39412,39409,39407,39404,39402,39400,39397,39395,39392,39390,39387,39385,39383,39380,39378,39375,39373,39370,39368,39365,39363,39361,39358,39356,39353,39351,39348,39346,39344,39341,39339,39336,39334,39331,39329,39327,39324,39322,39319,39317,39314,39312,39310,39307,39305,39302,39300,39298,39295,39293,39290,39288,39285,39283,39281,39278,39276,39273,39271,39268,39266,39264,39261,39259,39256,39254,39252,39249,39247,39244,39242,39240,39237,39235,39232,39230,39227,39225,39223,39220,39218,39215,39213,39211,39208,39206,39203,39201,39199,39196,39194,39191,39189,39187,39184,39182,39179,39177,39175,39172,39170,39167,39165,39163,39160,39158,39155,39153,39151,39148,39146,39143,39141,39139,39136,39134,39131,39129,39127,39124,39122,39119,39117,39115,39112,39110,39107,39105,39103,39100,39098,39095,39093,39091,39088,39086,39084,39081,39079,39076,39074,39072,39069,39067,39064,39062,39060,39057,39055,39052,39050,39048,39045,39043,39041,39038,39036,39033,39031,39029,39026,39024,39022,39019,39017,39014,39012,39010,39007,39005,39003,39000,38998,38995,38993,38991,38988,38986,38984,38981,38979,38976,38974,38972,38969,38967,38965,38962,38960,38957,38955,38953,38950,38948,38946,38943,38941,38939,38936,38934,38931,38929,38927,38924,38922,38920,38917,38915,38913,38910,38908,38905,38903,38901,38898,38896,38894,38891,38889,38887,38884,38882,38879,38877,38875,38872,38870,38868,38865,38863,38861,38858,38856,38854,38851,38849,38847,38844,38842,38839,38837,38835,38832,38830,38828,38825,38823,38821,38818,38816,38814,38811,38809,38807,38804,38802,38800,38797,38795,38793,38790,38788,38785,38783,38781,38778,38776,38774,38771,38769,38767,38764,38762,38760,38757,38755,38753,38750,38748,38746,38743,38741,38739,38736,38734,38732,38729,38727,38725,38722,38720,38718,38715,38713,38711,38708,38706,38704,38701,38699,38697,38694,38692,38690,38687,38685,38683,38680,38678,38676,38673,38671,38669,38666,38664,38662,38659,38657,38655,38652,38650,38648,38645,38643,38641,38639,38636,38634,38632,38629,38627,38625,38622,38620,38618,38615,38613,38611,38608,38606,38604,38601,38599,38597,38594,38592,38590,38588,38585,38583,38581,38578,38576,38574,38571,38569,38567,38564,38562,38560,38557,38555,38553,38551,38548,38546,38544,38541,38539,38537,38534,38532,38530,38527,38525,38523,38521,38518,38516,38514,38511,38509,38507,38504,38502,38500,38497,38495,38493,38491,38488,38486,38484,38481,38479,38477,38474,38472,38470,38468,38465,38463,38461,38458,38456,38454,38452,38449,38447,38445,38442,38440,38438,38435,38433,38431,38429,38426,38424,38422,38419,38417,38415,38413,38410,38408,38406,38403,38401,38399,38397,38394,38392,38390,38387,38385,38383,38380,38378,38376,38374,38371,38369,38367,38365,38362,38360,38358,38355,38353,38351,38349,38346,38344,38342,38339,38337,38335,38333,38330,38328,38326,38323,38321,38319,38317,38314,38312,38310,38308,38305,38303,38301,38298,38296,38294,38292,38289,38287,38285,38282,38280,38278,38276,38273,38271,38269,38267,38264,38262,38260,38257,38255,38253,38251,38248,38246,38244,38242,38239,38237,38235,38233,38230,38228,38226,38223,38221,38219,38217,38214,38212,38210,38208,38205,38203,38201,38199,38196,38194,38192,38190,38187,38185,38183,38181,38178,38176,38174,38171,38169,38167,38165,38162,38160,38158,38156,38153,38151,38149,38147,38144,38142,38140,38138,38135,38133,38131,38129,38126,38124,38122,38120,38117,38115,38113,38111,38108,38106,38104,38102,38099,38097,38095,38093,38090,38088,38086,38084,38081,38079,38077,38075,38072,38070,38068,38066,38063,38061,38059,38057,38054,38052,38050,38048,38045,38043,38041,38039,38037,38034,38032,38030,38028,38025,38023,38021,38019,38016,38014,38012,38010,38007,38005,38003,38001,37998,37996,37994,37992,37990,37987,37985,37983,37981,37978,37976,37974,37972,37969,37967,37965,37963,37960,37958,37956,37954,37952,37949,37947,37945,37943,37940,37938,37936,37934,37931,37929,37927,37925,37923,37920,37918,37916,37914,37911,37909,37907,37905,37903,37900,37898,37896,37894,37891,37889,37887,37885,37883,37880,37878,37876,37874,37871,37869,37867,37865,37863,37860,37858,37856,37854,37851,37849,37847,37845,37843,37840,37838,37836,37834,37832,37829,37827,37825,37823,37820,37818,37816,37814,37812,37809,37807,37805,37803,37801,37798,37796,37794,37792,37789,37787,37785,37783,37781,37778,37776,37774,37772,37770,37767,37765,37763,37761,37759,37756,37754,37752,37750,37748,37745,37743,37741,37739,37737,37734,37732,37730,37728,37726,37723,37721,37719,37717,37715,37712,37710,37708,37706,37704,37701,37699,37697,37695,37693,37690,37688,37686,37684,37682,37679,37677,37675,37673,37671,37668,37666,37664,37662,37660,37657,37655,37653,37651,37649,37646,37644,37642,37640,37638,37635,37633,37631,37629,37627,37625,37622,37620,37618,37616,37614,37611,37609,37607,37605,37603,37600,37598,37596,37594,37592,37589,37587,37585,37583,37581,37579,37576,37574,37572,37570,37568,37565,37563,37561,37559,37557,37555,37552,37550,37548,37546,37544,37541,37539,37537,37535,37533,37531,37528,37526,37524,37522,37520,37517,37515,37513,37511,37509,37507,37504,37502,37500,37498,37496,37494,37491,37489,37487,37485,37483,37481,37478,37476,37474,37472,37470,37467,37465,37463,37461,37459,37457,37454,37452,37450,37448,37446,37444,37441,37439,37437,37435,37433,37431,37428,37426,37424,37422,37420,37418,37415,37413,37411,37409,37407,37405,37402,37400,37398,37396,37394,37392,37389,37387,37385,37383,37381,37379,37376,37374,37372,37370,37368,37366,37364,37361,37359,37357,37355,37353,37351,37348,37346,37344,37342,37340,37338,37335,37333,37331,37329,37327,37325,37323,37320,37318,37316,37314,37312,37310,37307,37305,37303,37301,37299,37297,37295,37292,37290,37288,37286,37284,37282,37279,37277,37275,37273,37271,37269,37267,37264,37262,37260,37258,37256,37254,37252,37249,37247,37245,37243,37241,37239,37237,37234,37232,37230,37228,37226,37224,37221,37219,37217,37215,37213,37211,37209,37206,37204,37202,37200,37198,37196,37194,37192,37189,37187,37185,37183,37181,37179,37177,37174,37172,37170,37168,37166,37164,37162,37159,37157,37155,37153,37151,37149,37147,37144,37142,37140,37138,37136,37134,37132,37130,37127,37125,37123,37121,37119,37117,37115,37112,37110,37108,37106,37104,37102,37100,37098,37095,37093,37091,37089,37087,37085,37083,37081,37078,37076,37074,37072,37070,37068,37066,37063,37061,37059,37057,37055,37053,37051,37049,37046,37044,37042,37040,37038,37036,37034,37032,37029,37027,37025,37023,37021,37019,37017,37015,37013,37010,37008,37006,37004,37002,37000,36998,36996,36993,36991,36989,36987,36985,36983,36981,36979,36976,36974,36972,36970,36968,36966,36964,36962,36960,36957,36955,36953,36951,36949,36947,36945,36943,36941,36938,36936,36934,36932,36930,36928,36926,36924,36921,36919,36917,36915,36913,36911,36909,36907,36905,36902,36900,36898,36896,36894,36892,36890,36888,36886,36884,36881,36879,36877,36875,36873,36871,36869,36867,36865,36862,36860,36858,36856,36854,36852,36850,36848,36846,36844,36841,36839,36837,36835,36833,36831,36829,36827,36825,36822,36820,36818,36816,36814,36812,36810,36808,36806,36804,36801,36799,36797,36795,36793,36791,36789,36787,36785,36783,36781,36778,36776,36774,36772,36770,36768,36766,36764,36762,36760,36757,36755,36753,36751,36749,36747,36745,36743,36741,36739,36737,36734,36732,36730,36728,36726,36724,36722,36720,36718,36716,36714,36711,36709,36707,36705,36703,36701,36699,36697,36695,36693,36691,36688,36686,36684,36682,36680,36678,36676,36674,36672,36670,36668,36665,36663,36661,36659,36657,36655,36653,36651,36649,36647,36645,36643,36640,36638,36636,36634,36632,36630,36628,36626,36624,36622,36620,36618,36615,36613,36611,36609,36607,36605,36603,36601,36599,36597,36595,36593,36591,36588,36586,36584,36582,36580,36578,36576,36574,36572,36570,36568,36566,36564,36561,36559,36557,36555,36553,36551,36549,36547,36545,36543,36541,36539,36537,36535,36532,36530,36528,36526,36524,36522,36520,36518,36516,36514,36512,36510,36508,36506,36503,36501,36499,36497,36495,36493,36491,36489,36487,36485,36483,36481,36479,36477,36474,36472,36470,36468,36466,36464,36462,36460,36458,36456,36454,36452,36450,36448,36446,36444,36441,36439,36437,36435,36433,36431,36429,36427,36425,36423,36421,36419,36417,36415,36413,36411,36408,36406,36404,36402,36400,36398,36396,36394,36392,36390,36388,36386,36384,36382,36380,36378,36376,36373,36371,36369,36367,36365,36363,36361,36359,36357,36355,36353,36351,36349,36347,36345,36343,36341,36339,36336,36334,36332,36330,36328,36326,36324,36322,36320,36318,36316,36314,36312,36310,36308,36306,36304,36302,36300,36297,36295,36293,36291,36289,36287,36285,36283,36281,36279,36277,36275,36273,36271,36269,36267,36265,36263,36261,36259,36257,36254,36252,36250,36248,36246,36244,36242,36240,36238,36236,36234,36232,36230,36228,36226,36224,36222,36220,36218,36216,36214,36212,36210,36207,36205,36203,36201,36199,36197,36195,36193,36191,36189,36187,36185,36183,36181,36179,36177,36175,36173,36171,36169,36167,36165,36163,36161,36159,36157,36154,36152,36150,36148,36146,36144,36142,36140,36138,36136,36134,36132,36130,36128,36126,36124,36122,36120,36118,36116,36114,36112,36110,36108,36106,36104,36102,36100,36098,36095,36093,36091,36089,36087,36085,36083,36081,36079,36077,36075,36073,36071,36069,36067,36065,36063,36061,36059,36057,36055,36053,36051,36049,36047,36045,36043,36041,36039,36037,36035,36033,36031,36029,36027,36025,36022,36020,36018,36016,36014,36012,36010,36008,36006,36004,36002,36000,35998,35996,35994,35992,35990,35988,35986,35984,35982,35980,35978,35976,35974,35972,35970,35968,35966,35964,35962,35960,35958,35956,35954,35952,35950,35948,35946,35944,35942,35940,35938,35936,35934,35932,35930,35928,35926,35924,35922,35919,35917,35915,35913,35911,35909,35907,35905,35903,35901,35899,35897,35895,35893,35891,35889,35887,35885,35883,35881,35879,35877,35875,35873,35871,35869,35867,35865,35863,35861,35859,35857,35855,35853,35851,35849,35847,35845,35843,35841,35839,35837,35835,35833,35831,35829,35827,35825,35823,35821,35819,35817,35815,35813,35811,35809,35807,35805,35803,35801,35799,35797,35795,35793,35791,35789,35787,35785,35783,35781,35779,35777,35775,35773,35771,35769,35767,35765,35763,35761,35759,35757,35755,35753,35751,35749,35747,35745,35743,35741,35739,35737,35735,35733,35731,35729,35727,35725,35723,35721,35719,35717,35715,35713,35711,35709,35707,35705,35703,35701,35699,35697,35695,35693,35691,35689,35687,35685,35683,35681,35679,35677,35675,35673,35671,35669,35667,35665,35663,35661,35659,35657,35655,35653,35651,35649,35647,35645,35643,35641,35639,35637,35635,35633,35631,35629,35627,35625,35623,35621,35619,35617,35615,35613,35611,35609,35607,35605,35603,35601,35599,35597,35595,35593,35591,35589,35587,35585,35583,35581,35579,35577,35575,35573,35571,35569,35567,35565,35564,35562,35560,35558,35556,35554,35552,35550,35548,35546,35544,35542,35540,35538,35536,35534,35532,35530,35528,35526,35524,35522,35520,35518,35516,35514,35512,35510,35508,35506,35504,35502,35500,35498,35496,35494,35492,35490,35488,35486,35484,35482,35480,35478,35476,35474,35472,35470,35468,35466,35464,35462,35461,35459,35457,35455,35453,35451,35449,35447,35445,35443,35441,35439,35437,35435,35433,35431,35429,35427,35425,35423,35421,35419,35417,35415,35413,35411,35409,35407,35405,35403,35401,35399,35397,35395,35393,35391,35389,35387,35386,35384,35382,35380,35378,35376,35374,35372,35370,35368,35366,35364,35362,35360,35358,35356,35354,35352,35350,35348,35346,35344,35342,35340,35338,35336,35334,35332,35330,35328,35326,35325,35323,35321,35319,35317,35315,35313,35311,35309,35307,35305,35303,35301,35299,35297,35295,35293,35291,35289,35287,35285,35283,35281,35279,35277,35275,35273,35272,35270,35268,35266,35264,35262,35260,35258,35256,35254,35252,35250,35248,35246,35244,35242,35240,35238,35236,35234,35232,35230,35228,35226,35224,35223,35221,35219,35217,35215,35213,35211,35209,35207,35205,35203,35201,35199,35197,35195,35193,35191,35189,35187,35185,35183,35181,35179,35178,35176,35174,35172,35170,35168,35166,35164,35162,35160,35158,35156,35154,35152,35150,35148,35146,35144,35142,35140,35138,35137,35135,35133,35131,35129,35127,35125,35123,35121,35119,35117,35115,35113,35111,35109,35107,35105,35103,35101,35099,35098,35096,35094,35092,35090,35088,35086,35084,35082,35080,35078,35076,35074,35072,35070,35068,35066,35064,35063,35061,35059,35057,35055,35053,35051,35049,35047,35045,35043,35041,35039,35037,35035,35033,35031,35029,35028,35026,35024,35022,35020,35018,35016,35014,35012,35010,35008,35006,35004,35002,35000,34998,34996,34995,34993,34991,34989,34987,34985,34983,34981,34979,34977,34975,34973,34971,34969,34967,34965,34964,34962,34960,34958,34956,34954,34952,34950,34948,34946,34944,34942,34940,34938,34936,34934,34933,34931,34929,34927,34925,34923,34921,34919,34917,34915,34913,34911,34909,34907,34905,34904,34902,34900,34898,34896,34894,34892,34890,34888,34886,34884,34882,34880,34878,34876,34875,34873,34871,34869,34867,34865,34863,34861,34859,34857,34855,34853,34851,34849,34847,34846,34844,34842,34840,34838,34836,34834,34832,34830,34828,34826,34824,34822,34821,34819,34817,34815,34813,34811,34809,34807,34805,34803,34801,34799,34797,34795,34794,34792,34790,34788,34786,34784,34782,34780,34778,34776,34774,34772,34770,34769,34767,34765,34763,34761,34759,34757,34755,34753,34751,34749,34747,34745,34744,34742,34740,34738,34736,34734,34732,34730,34728,34726,34724,34722,34720,34719,34717,34715,34713,34711,34709,34707,34705,34703,34701,34699,34697,34696,34694,34692,34690,34688,34686,34684,34682,34680,34678,34676,34674,34673,34671,34669,34667,34665,34663,34661,34659,34657,34655,34653,34651,34650,34648,34646,34644,34642,34640,34638,34636,34634,34632,34630,34628,34627,34625,34623,34621,34619,34617,34615,34613,34611,34609,34607,34606,34604,34602,34600,34598,34596,34594,34592,34590,34588,34586,34585,34583,34581,34579,34577,34575,34573,34571,34569,34567,34565,34564,34562,34560,34558,34556,34554,34552,34550,34548,34546,34544,34543,34541,34539,34537,34535,34533,34531,34529,34527,34525,34523,34522,34520,34518,34516,34514,34512,34510,34508,34506,34504,34502,34501,34499,34497,34495,34493,34491,34489,34487,34485,34483,34482,34480,34478,34476,34474,34472,34470,34468,34466,34464,34463,34461,34459,34457,34455,34453,34451,34449,34447,34445,34444,34442,34440,34438,34436,34434,34432,34430,34428,34426,34425,34423,34421,34419,34417,34415,34413,34411,34409,34407,34406,34404,34402,34400,34398,34396,34394,34392,34390,34388,34387,34385,34383,34381,34379,34377,34375,34373,34371,34369,34368,34366,34364,34362,34360,34358,34356,34354,34352,34351,34349,34347,34345,34343,34341,34339,34337,34335,34333,34332,34330,34328,34326,34324,34322,34320,34318,34316,34315,34313,34311,34309,34307,34305,34303,34301,34299,34298,34296,34294,34292,34290,34288,34286,34284,34282,34281,34279,34277,34275,34273,34271,34269,34267,34265,34264,34262,34260,34258,34256,34254,34252,34250,34248,34247,34245,34243,34241,34239,34237,34235,34233,34231,34230,34228,34226,34224,34222,34220,34218,34216,34214,34213,34211,34209,34207,34205,34203,34201,34199,34198,34196,34194,34192,34190,34188,34186,34184,34182,34181,34179,34177,34175,34173,34171,34169,34167,34166,34164,34162,34160,34158,34156,34154,34152,34150,34149,34147,34145,34143,34141,34139,34137,34135,34134,34132,34130,34128,34126,34124,34122,34120,34118,34117,34115,34113,34111,34109,34107,34105,34103,34102,34100,34098,34096,34094,34092,34090,34088,34087,34085,34083,34081,34079,34077,34075,34073,34072,34070,34068,34066,34064,34062,34060,34058,34057,34055,34053,34051,34049,34047,34045,34043,34042,34040,34038,34036,34034,34032,34030,34028,34027,34025,34023,34021,34019,34017,34015,34013,34012,34010,34008,34006,34004,34002,34000,33998,33997,33995,33993,33991,33989,33987,33985,33984,33982,33980,33978,33976,33974,33972,33970,33969,33967,33965,33963,33961,33959,33957,33955,33954,33952,33950,33948,33946,33944,33942,33941,33939,33937,33935,33933,33931,33929,33927,33926,33924,33922,33920,33918,33916,33914,33913,33911,33909,33907,33905,33903,33901,33899,33898,33896,33894,33892,33890,33888,33886,33885,33883,33881,33879,33877,33875,33873,33871,33870,33868,33866,33864,33862,33860,33858,33857,33855,33853,33851,33849,33847,33845,33844,33842,33840,33838,33836,33834,33832,33831,33829,33827,33825,33823,33821,33819,33818,33816,33814,33812,33810,33808,33806,33804,33803,33801,33799,33797,33795,33793,33791,33790,33788,33786,33784,33782,33780,33778,33777,33775,33773,33771,33769,33767,33765,33764,33762,33760,33758,33756,33754,33752,33751,33749,33747,33745,33743,33741,33739,33738,33736,33734,33732,33730,33728,33726,33725,33723,33721,33719,33717,33715,33714,33712,33710,33708,33706,33704,33702,33701,33699,33697,33695,33693,33691,33689,33688,33686,33684,33682,33680,33678,33676,33675,33673,33671,33669,33667,33665,33663,33662,33660,33658,33656,33654,33652,33651,33649,33647,33645,33643,33641,33639,33638,33636,33634,33632,33630,33628,33627,33625,33623,33621,33619,33617,33615,33614,33612,33610,33608,33606,33604,33602,33601,33599,33597,33595,33593,33591,33590,33588,33586,33584,33582,33580,33578,33577,33575,33573,33571,33569,33567,33566,33564,33562,33560,33558,33556,33554,33553,33551,33549,33547,33545,33543,33542,33540,33538,33536,33534,33532,33531,33529,33527,33525,33523,33521,33519,33518,33516,33514,33512,33510,33508,33507,33505,33503,33501,33499,33497,33496,33494,33492,33490,33488,33486,33484,33483,33481,33479,33477,33475,33473,33472,33470,33468,33466,33464,33462,33461,33459,33457,33455,33453,33451,33450,33448,33446,33444,33442,33440,33438,33437,33435,33433,33431,33429,33427,33426,33424,33422,33420,33418,33416,33415,33413,33411,33409,33407,33405,33404,33402,33400,33398,33396,33394,33393,33391,33389,33387,33385,33383,33382,33380,33378,33376,33374,33372,33371,33369,33367,33365,33363,33361,33360,33358,33356,33354,33352,33350,33349,33347,33345,33343,33341,33339,33338,33336,33334,33332,33330,33328,33327,33325,33323,33321,33319,33317,33316,33314,33312,33310,33308,33306,33305,33303,33301,33299,33297,33295,33294,33292,33290,33288,33286,33284,33283,33281,33279,33277,33275,33274,33272,33270,33268,33266,33264,33263,33261,33259,33257,33255,33253,33252,33250,33248,33246,33244,33242,33241,33239,33237,33235,33233,33231,33230,33228,33226,33224,33222,33221,33219,33217,33215,33213,33211,33210,33208,33206,33204,33202,33200,33199,33197,33195,33193,33191,33190,33188,33186,33184,33182,33180,33179,33177,33175,33173,33171,33169,33168,33166,33164,33162,33160,33159,33157,33155,33153,33151,33149,33148,33146,33144,33142,33140,33138,33137,33135,33133,33131,33129,33128,33126,33124,33122,33120,33118,33117,33115,33113,33111,33109,33108,33106,33104,33102,33100,33098,33097,33095,33093,33091,33089,33088,33086,33084,33082,33080,33078,33077,33075,33073,33071,33069,33068,33066,33064,33062,33060,33058,33057,33055,33053,33051,33049,33048,33046,33044,33042,33040,33038,33037,33035,33033,33031,33029,33028,33026,33024,33022,33020,33018,33017,33015,33013,33011,33009,33008,33006,33004,33002,33000,32999,32997,32995,32993,32991,32989,32988,32986,32984,32982,32980,32979,32977,32975,32973,32971,32970,32968,32966,32964,32962,32960,32959,32957,32955,32953,32951,32950,32948,32946,32944,32942,32941,32939,32937,32935,32933,32932,32930,32928,32926,32924,32922,32921,32919,32917,32915,32913,32912,32910,32908,32906,32904,32903,32901,32899,32897,32895,32894,32892,32890,32888,32886,32884,32883,32881,32879,32877,32875,32874,32872,32870,32868,32866,32865,32863,32861,32859,32857,32856,32854,32852,32850,32848,32847,32845,32843,32841,32839,32837,32836,32834,32832,32830,32828,32827,32825,32823,32821,32819,32818,32816,32814,32812,32810,32809,32807,32805,32803,32801,32800,32798,32796,32794,32792,32791,32789,32787,32785,32783,32782,32780,32778,32776,32774,32773,32771,32769,32767,32765,32764,32762,32760,32758,32756,32755,32753,32751,32749,32747,32746,32744,32742,32740,32738,32737,32735,32733,32731,32729,32728,32726,32724,32722,32720,32719,32717,32715,32713,32711,32710,32708,32706,32704,32702,32701,32699,32697,32695,32693,32692,32690,32688,32686,32684,32683,32681,32679,32677,32675,32674,32672,32670,32668,32666,32665,32663,32661,32659,32657,32656,32654,32652,32650,32648,32647,32645,32643,32641,32639,32638,32636,32634,32632,32630,32629,32627,32625,32623,32622,32620,32618,32616,32614,32613,32611,32609,32607,32605,32604,32602,32600,32598,32596,32595,32593,32591,32589,32587,32586,32584,32582,32580,32578,32577,32575,32573,32571,32570,32568,32566,32564,32562,32561,32559,32557,32555,32553,32552,32550,32548,32546,32544,32543,32541,32539,32537,32535,32534,32532,32530,32528,32527,32525,32523,32521,32519,32518,32516,32514,32512,32510,32509,32507,32505,32503,32501,32500,32498,32496,32494,32493,32491,32489,32487,32485,32484,32482,32480,32478,32476,32475,32473,32471,32469,32467,32466,32464,32462,32460,32459,32457,32455,32453,32451,32450,32448,32446,32444,32442,32441,32439,32437,32435,32434,32432,32430,32428,32426,32425,32423,32421,32419,32417,32416,32414,32412,32410,32409,32407,32405,32403,32401,32400,32398,32396,32394,32393,32391,32389,32387,32385,32384,32382,32380,32378,32376,32375,32373,32371,32369,32368,32366,32364,32362,32360,32359,32357,32355,32353,32352,32350,32348,32346,32344,32343,32341,32339,32337,32335,32334,32332,32330,32328,32327,32325,32323,32321,32319,32318,32316,32314,32312,32311,32309,32307,32305,32303,32302,32300,32298,32296,32295,32293,32291,32289,32287,32286,32284,32282,32280,32279,32277,32275,32273,32271,32270,32268,32266,32264,32263,32261,32259,32257,32255,32254,32252,32250,32248,32247,32245,32243,32241,32239,32238,32236,32234,32232,32231,32229,32227,32225,32223,32222,32220,32218,32216,32215,32213,32211,32209,32207,32206,32204,32202,32200,32199,32197,32195,32193,32191,32190,32188,32186,32184,32183,32181,32179,32177,32176,32174,32172,32170,32168,32167,32165,32163,32161,32160,32158,32156,32154,32152,32151,32149,32147,32145,32144,32142,32140,32138,32137,32135,32133,32131,32129,32128,32126,32124,32122,32121,32119,32117,32115,32113,32112,32110,32108,32106,32105,32103,32101,32099,32098,32096,32094,32092,32090,32089,32087,32085,32083,32082,32080,32078,32076,32075,32073,32071,32069,32067,32066,32064,32062,32060,32059,32057,32055,32053,32052,32050,32048,32046,32044,32043,32041,32039,32037,32036,32034,32032,32030,32029,32027,32025,32023,32022,32020,32018,32016,32014,32013,32011,32009,32007,32006,32004,32002,32000,31999,31997,31995,31993,31991,31990,31988,31986,31984,31983,31981,31979,31977,31976,31974,31972,31970,31969,31967,31965,31963,31961,31960,31958,31956,31954,31953,31951,31949,31947,31946,31944,31942,31940,31939,31937,31935,31933,31932,31930,31928,31926,31924,31923,31921,31919,31917,31916,31914,31912,31910,31909,31907,31905,31903,31902,31900,31898,31896,31895,31893,31891,31889,31887,31886,31884,31882,31880,31879,31877,31875,31873,31872,31870,31868,31866,31865,31863,31861,31859,31858,31856,31854,31852,31850,31849,31847,31845,31843,31842,31840,31838,31836,31835,31833,31831,31829,31828,31826,31824,31822,31821,31819,31817,31815,31814,31812,31810,31808,31807,31805,31803,31801,31799,31798,31796,31794,31792,31791,31789,31787,31785,31784,31782,31780,31778,31777,31775,31773,31771,31770,31768,31766,31764,31763,31761,31759,31757,31756,31754,31752,31750,31749,31747,31745,31743,31742,31740,31738,31736,31735,31733,31731,31729,31728,31726,31724,31722,31720,31719,31717,31715,31713,31712,31710,31708,31706,31705,31703,31701,31699,31698,31696,31694,31692,31691,31689,31687,31685,31684,31682,31680,31678,31677,31675,31673,31671,31670,31668,31666,31664,31663,31661,31659,31657,31656,31654,31652,31650,31649,31647,31645,31643,31642,31640,31638,31636,31635,31633,31631,31629,31628,31626,31624,31622,31621,31619,31617,31615,31614,31612,31610,31608,31607,31605,31603,31601,31600,31598,31596,31594,31593,31591,31589,31587,31586,31584,31582,31580,31579,31577,31575,31573,31572,31570,31568,31566,31565,31563,31561,31559,31558,31556,31554,31552,31551,31549,31547,31545,31544,31542,31540,31538,31537,31535,31533,31531,31530,31528,31526,31524,31523,31521,31519,31517,31516,31514,31512,31510,31509,31507,31505,31504,31502,31500,31498,31497,31495,31493,31491,31490,31488,31486,31484,31483,31481,31479,31477,31476,31474,31472,31470,31469,31467,31465,31463,31462,31460,31458,31456,31455,31453,31451,31449,31448,31446,31444,31442,31441,31439,31437,31435,31434,31432,31430,31429,31427,31425,31423,31422,31420,31418,31416,31415,31413,31411,31409,31408,31406,31404,31402,31401,31399,31397,31395,31394,31392,31390,31388,31387,31385,31383,31382,31380,31378,31376,31375,31373,31371,31369,31368,31366,31364,31362,31361,31359,31357,31355,31354,31352,31350,31348,31347,31345,31343,31341,31340,31338,31336,31335,31333,31331,31329,31328,31326,31324,31322,31321,31319,31317,31315,31314,31312,31310,31308,31307,31305,31303,31301,31300,31298,31296,31295,31293,31291,31289,31288,31286,31284,31282,31281,31279,31277,31275,31274,31272,31270,31268,31267,31265,31263,31262,31260,31258,31256,31255,31253,31251,31249,31248,31246,31244,31242,31241,31239,31237,31236,31234,31232,31230,31229,31227,31225,31223,31222,31220,31218,31216,31215,31213,31211,31209,31208,31206,31204,31203,31201,31199,31197,31196,31194,31192,31190,31189,31187,31185,31183,31182,31180,31178,31177,31175,31173,31171,31170,31168,31166,31164,31163,31161,31159,31157,31156,31154,31152,31151,31149,31147,31145,31144,31142,31140,31138,31137,31135,31133,31132,31130,31128,31126,31125,31123,31121,31119,31118,31116,31114,31112,31111,31109,31107,31106,31104,31102,31100,31099,31097,31095,31093,31092,31090,31088,31087,31085,31083,31081,31080,31078,31076,31074,31073,31071,31069,31067,31066,31064,31062,31061,31059,31057,31055,31054,31052,31050,31048,31047,31045,31043,31042,31040,31038,31036,31035,31033,31031,31029,31028,31026,31024,31023,31021,31019,31017,31016,31014,31012,31010,31009,31007,31005,31004,31002,31000,30998,30997,30995,30993,30991,30990,30988,30986,30985,30983,30981,30979,30978,30976,30974,30972,30971,30969,30967,30966,30964,30962,30960,30959,30957,30955,30954,30952,30950,30948,30947,30945,30943,30941,30940,30938,30936,30935,30933,30931,30929,30928,30926,30924,30922,30921,30919,30917,30916,30914,30912,30910,30909,30907,30905,30903,30902,30900,30898,30897,30895,30893,30891,30890,30888,30886,30885,30883,30881,30879,30878,30876,30874,30872,30871,30869,30867,30866,30864,30862,30860,30859,30857,30855,30854,30852,30850,30848,30847,30845,30843,30841,30840,30838,30836,30835,30833,30831,30829,30828,30826,30824,30823,30821,30819,30817,30816,30814,30812,30811,30809,30807,30805,30804,30802,30800,30798,30797,30795,30793,30792,30790,30788,30786,30785,30783,30781,30780,30778,30776,30774,30773,30771,30769,30768,30766,30764,30762,30761,30759,30757,30755,30754,30752,30750,30749,30747,30745,30743,30742,30740,30738,30737,30735,30733,30731,30730,30728,30726,30725,30723,30721,30719,30718,30716,30714,30713,30711,30709,30707,30706,30704,30702,30701,30699,30697,30695,30694,30692,30690,30689,30687,30685,30683,30682,30680,30678,30677,30675,30673,30671,30670,30668,30666,30665,30663,30661,30659,30658,30656,30654,30652,30651,30649,30647,30646,30644,30642,30640,30639,30637,30635,30634,30632,30630,30628,30627,30625,30623,30622,30620,30618,30616,30615,30613,30611,30610,30608,30606,30604,30603,30601,30599,30598,30596,30594,30593,30591,30589,30587,30586,30584,30582,30581,30579,30577,30575,30574,30572,30570,30569,30567,30565,30563,30562,30560,30558,30557,30555,30553,30551,30550,30548,30546,30545,30543,30541,30539,30538,30536,30534,30533,30531,30529,30527,30526,30524,30522,30521,30519,30517,30515,30514,30512,30510,30509,30507,30505,30503,30502,30500,30498,30497,30495,30493,30492,30490,30488,30486,30485,30483,30481,30480,30478,30476,30474,30473,30471,30469,30468,30466,30464,30462,30461,30459,30457,30456,30454,30452,30451,30449,30447,30445,30444,30442,30440,30439,30437,30435,30433,30432,30430,30428,30427,30425,30423,30421,30420,30418,30416,30415,30413,30411,30410,30408,30406,30404,30403,30401,30399,30398,30396,30394,30392,30391,30389,30387,30386,30384,30382,30380,30379,30377,30375,30374,30372,30370,30369,30367,30365,30363,30362,30360,30358,30357,30355,30353,30351,30350,30348,30346,30345,30343,30341,30340,30338,30336,30334,30333,30331,30329,30328,30326,30324,30322,30321,30319,30317,30316,30314,30312,30311,30309,30307,30305,30304,30302,30300,30299,30297,30295,30294,30292,30290,30288,30287,30285,30283,30282,30280,30278,30276,30275,30273,30271,30270,30268,30266,30265,30263,30261,30259,30258,30256,30254,30253,30251,30249,30248,30246,30244,30242,30241,30239,30237,30236,30234,30232,30231,30229,30227,30225,30224,30222,30220,30219,30217,30215,30213,30212,30210,30208,30207,30205,30203,30202,30200,30198,30196,30195,30193,30191,30190,30188,30186,30185,30183,30181,30179,30178,30176,30174,30173,30171,30169,30168,30166,30164,30162,30161,30159,30157,30156,30154,30152,30151,30149,30147,30145,30144,30142,30140,30139,30137,30135,30134,30132,30130,30128,30127,30125,30123,30122,30120,30118,30117,30115,30113,30111,30110,30108,30106,30105,30103,30101,30100,30098,30096,30095,30093,30091,30089,30088,30086,30084,30083,30081,30079,30078,30076,30074,30072,30071,30069,30067,30066,30064,30062,30061,30059,30057,30055,30054,30052,30050,30049,30047,30045,30044,30042,30040,30038,30037,30035,30033,30032,30030,30028,30027,30025,30023,30022,30020,30018,30016,30015,30013,30011,30010,30008,30006,30005,30003,30001,29999,29998,29996,29994,29993,29991,29989,29988,29986,29984,29983,29981,29979,29977,29976,29974,29972,29971,29969,29967,29966,29964,29962,29961,29959,29957,29955,29954,29952,29950,29949,29947,29945,29944,29942,29940,29938,29937,29935,29933,29932,29930,29928,29927,29925,29923,29922,29920,29918,29916,29915,29913,29911,29910,29908,29906,29905,29903,29901,29900,29898,29896,29894,29893,29891,29889,29888,29886,29884,29883,29881,29879,29878,29876,29874,29872,29871,29869,29867,29866,29864,29862,29861,29859,29857,29856,29854,29852,29850,29849,29847,29845,29844,29842,29840,29839,29837,29835,29834,29832,29830,29828,29827,29825,29823,29822,29820,29818,29817,29815,29813,29812,29810,29808,29807,29805,29803,29801,29800,29798,29796,29795,29793,29791,29790,29788,29786,29785,29783,29781,29779,29778,29776,29774,29773,29771,29769,29768,29766,29764,29763,29761,29759,29758,29756,29754,29752,29751,29749,29747,29746,29744,29742,29741,29739,29737,29736,29734,29732,29730,29729,29727,29725,29724,29722,29720,29719,29717,29715,29714,29712,29710,29709,29707,29705,29703,29702,29700,29698,29697,29695,29693,29692,29690,29688,29687,29685,29683,29682,29680,29678,29676,29675,29673,29671,29670,29668,29666,29665,29663,29661,29660,29658,29656,29655,29653,29651,29649,29648,29646,29644,29643,29641,29639,29638,29636,29634,29633,29631,29629,29628,29626,29624,29623,29621,29619,29617,29616,29614,29612,29611,29609,29607,29606,29604,29602,29601,29599,29597,29596,29594,29592,29590,29589,29587,29585,29584,29582,29580,29579,29577,29575,29574,29572,29570,29569,29567,29565,29564,29562,29560,29558,29557,29555,29553,29552,29550,29548,29547,29545,29543,29542,29540,29538,29537,29535,29533,29532,29530,29528,29527,29525,29523,29521,29520,29518,29516,29515,29513,29511,29510,29508,29506,29505,29503,29501,29500,29498,29496,29495,29493,29491,29489,29488,29486,29484,29483,29481,29479,29478,29476,29474,29473,29471,29469,29468,29466,29464,29463,29461,29459,29458,29456,29454,29452,29451,29449,29447,29446,29444,29442,29441,29439,29437,29436,29434,29432,29431,29429,29427,29426,29424,29422,29421,29419,29417,29415,29414,29412,29410,29409,29407,29405,29404,29402,29400,29399,29397,29395,29394,29392,29390,29389,29387,29385,29384,29382,29380,29379,29377,29375,29373,29372,29370,29368,29367,29365,29363,29362,29360,29358,29357,29355,29353,29352,29350,29348,29347,29345,29343,29342,29340,29338,29337,29335,29333,29332,29330,29328,29326,29325,29323,29321,29320,29318,29316,29315,29313,29311,29310,29308,29306,29305,29303,29301,29300,29298,29296,29295,29293,29291,29290,29288,29286,29285,29283,29281,29279,29278,29276,29274,29273,29271,29269,29268,29266,29264,29263,29261,29259,29258,29256,29254,29253,29251,29249,29248,29246,29244,29243,29241,29239,29238,29236,29234,29233,29231,29229,29228,29226,29224,29222,29221,29219,29217,29216,29214,29212,29211,29209,29207,29206,29204,29202,29201,29199,29197,29196,29194,29192,29191,29189,29187,29186,29184,29182,29181,29179,29177,29176,29174,29172,29171,29169,29167,29166,29164,29162,29160,29159,29157,29155,29154,29152,29150,29149,29147,29145,29144,29142,29140,29139,29137,29135,29134,29132,29130,29129,29127,29125,29124,29122,29120,29119,29117,29115,29114,29112,29110,29109,29107,29105,29104,29102,29100,29099,29097,29095,29094,29092,29090,29089,29087,29085,29083,29082,29080,29078,29077,29075,29073,29072,29070,29068,29067,29065,29063,29062,29060,29058,29057,29055,29053,29052,29050,29048,29047,29045,29043,29042,29040,29038,29037,29035,29033,29032,29030,29028,29027,29025,29023,29022,29020,29018,29017,29015,29013,29012,29010,29008,29007,29005,29003,29002,29000,28998,28997,28995,28993,28992,28990,28988,28986,28985,28983,28981,28980,28978,28976,28975,28973,28971,28970,28968,28966,28965,28963,28961,28960,28958,28956,28955,28953,28951,28950,28948,28946,28945,28943,28941,28940,28938,28936,28935,28933,28931,28930,28928,28926,28925,28923,28921,28920,28918,28916,28915,28913,28911,28910,28908,28906,28905,28903,28901,28900,28898,28896,28895,28893,28891,28890,28888,28886,28885,28883,28881,28880,28878,28876,28875,28873,28871,28870,28868,28866,28865,28863,28861,28860,28858,28856,28855,28853,28851,28850,28848,28846,28845,28843,28841,28840,28838,28836,28835,28833,28831,28830,28828,28826,28825,28823,28821,28820,28818,28816,28815,28813,28811,28810,28808,28806,28805,28803,28801,28800,28798,28796,28795,28793,28791,28790,28788,28786,28785,28783,28781,28780,28778,28776,28775,28773,28771,28770,28768,28766,28765,28763,28761,28760,28758,28756,28755,28753,28751,28750,28748,28746,28745,28743,28741,28740,28738,28736,28735,28733,28731,28730,28728,28726,28725,28723,28721,28720,28718,28716,28715,28713,28711,28710,28708,28706,28705,28703,28701,28700,28698,28696,28695,28693,28691,28690,28688,28686,28685,28683,28681,28680,28678,28676,28675,28673,28671,28670,28668,28666,28665,28663,28661,28660,28658,28656,28655,28653,28651,28650,28648,28646,28645,28643,28641,28640,28638,28636,28635,28633,28631,28630,28628,28626,28625,28623,28621,28620,28618,28616,28615,28613,28611,28610,28608,28606,28605,28603,28601,28600,28598,28596,28595,28593,28591,28590,28588,28586,28585,28583,28581,28580,28578,28576,28575,28573,28571,28570,28568,28566,28565,28563,28561,28560,28558,28556,28555,28553,28551,28550,28548,28546,28545,28543,28541,28540,28538,28536,28535,28533,28531,28530,28528,28526,28525,28523,28522,28520,28518,28517,28515,28513,28512,28510,28508,28507,28505,28503,28502,28500,28498,28497,28495,28493,28492,28490,28488,28487,28485,28483,28482,28480,28478,28477,28475,28473,28472,28470,28468,28467,28465,28463,28462,28460,28458,28457,28455,28453,28452,28450,28448,28447,28445,28443,28442,28440,28438,28437,28435,28433,28432,28430,28428,28427,28425,28423,28422,28420,28418,28417,28415,28414,28412,28410,28409,28407,28405,28404,28402,28400,28399,28397,28395,28394,28392,28390,28389,28387,28385,28384,28382,28380,28379,28377,28375,28374,28372,28370,28369,28367,28365,28364,28362,28360,28359,28357,28355,28354,28352,28350,28349,28347,28345,28344,28342,28340,28339,28337,28335,28334,28332,28331,28329,28327,28326,28324,28322,28321,28319,28317,28316,28314,28312,28311,28309,28307,28306,28304,28302,28301,28299,28297,28296,28294,28292,28291,28289,28287,28286,28284,28282,28281,28279,28277,28276,28274,28272,28271,28269,28267,28266,28264,28263,28261,28259,28258,28256,28254,28253,28251,28249,28248,28246,28244,28243,28241,28239,28238,28236,28234,28233,28231,28229,28228,28226,28224,28223,28221,28219,28218,28216,28214,28213,28211,28209,28208,28206,28204,28203,28201,28200,28198,28196,28195,28193,28191,28190,28188,28186,28185,28183,28181,28180,28178,28176,28175,28173,28171,28170,28168,28166,28165,28163,28161,28160,28158,28156,28155,28153,28151,28150,28148,28147,28145,28143,28142,28140,28138,28137,28135,28133,28132,28130,28128,28127,28125,28123,28122,28120,28118,28117,28115,28113,28112,28110,28108,28107,28105,28103,28102,28100,28098,28097,28095,28094,28092,28090,28089,28087,28085,28084,28082,28080,28079,28077,28075,28074,28072,28070,28069,28067,28065,28064,28062,28060,28059,28057,28055,28054,28052,28050,28049,28047,28046,28044,28042,28041,28039,28037,28036,28034,28032,28031,28029,28027,28026,28024,28022,28021,28019,28017,28016,28014,28012,28011,28009,28007,28006,28004,28003,28001,27999,27998,27996,27994,27993,27991,27989,27988,27986,27984,27983,27981,27979,27978,27976,27974,27973,27971,27969,27968,27966,27964,27963,27961,27960,27958,27956,27955,27953,27951,27950,27948,27946,27945,27943,27941,27940,27938,27936,27935,27933,27931,27930,27928,27926,27925,27923,27921,27920,27918,27917,27915,27913,27912,27910,27908,27907,27905,27903,27902,27900,27898,27897,27895,27893,27892,27890,27888,27887,27885,27883,27882,27880,27879,27877,27875,27874,27872,27870,27869,27867,27865,27864,27862,27860,27859,27857,27855,27854,27852,27850,27849,27847,27845,27844,27842,27841,27839,27837,27836,27834,27832,27831,27829,27827,27826,27824,27822,27821,27819,27817,27816,27814,27812,27811,27809,27807,27806,27804,27803,27801,27799,27798,27796,27794,27793,27791,27789,27788,27786,27784,27783,27781,27779,27778,27776,27774,27773,27771,27769,27768,27766,27765,27763,27761,27760,27758,27756,27755,27753,27751,27750,27748,27746,27745,27743,27741,27740,27738,27736,27735,27733,27732,27730,27728,27727,27725,27723,27722,27720,27718,27717,27715,27713,27712,27710,27708,27707,27705,27703,27702,27700,27699,27697,27695,27694,27692,27690,27689,27687,27685,27684,27682,27680,27679,27677,27675,27674,27672,27670,27669,27667,27666,27664,27662,27661,27659,27657,27656,27654,27652,27651,27649,27647,27646,27644,27642,27641,27639,27637,27636,27634,27633,27631,27629,27628,27626,27624,27623,27621,27619,27618,27616,27614,27613,27611,27609,27608,27606,27604,27603,27601,27600,27598,27596,27595,27593,27591,27590,27588,27586,27585,27583,27581,27580,27578,27576,27575,27573,27571,27570,27568,27567,27565,27563,27562,27560,27558,27557,27555,27553,27552,27550,27548,27547,27545,27543,27542,27540,27539,27537,27535,27534,27532,27530,27529,27527,27525,27524,27522,27520,27519,27517,27515,27514,27512,27511,27509,27507,27506,27504,27502,27501,27499,27497,27496,27494,27492,27491,27489,27487,27486,27484,27482,27481,27479,27478,27476,27474,27473,27471,27469,27468,27466,27464,27463,27461,27459,27458,27456,27454,27453,27451,27450,27448,27446,27445,27443,27441,27440,27438,27436,27435,27433,27431,27430,27428,27426,27425,27423,27422,27420,27418,27417,27415,27413,27412,27410,27408,27407,27405,27403,27402,27400,27398,27397,27395,27394,27392,27390,27389,27387,27385,27384,27382,27380,27379,27377,27375,27374,27372,27370,27369,27367,27366,27364,27362,27361,27359,27357,27356,27354,27352,27351,27349,27347,27346,27344,27342,27341,27339,27338,27336,27334,27333,27331,27329,27328,27326,27324,27323,27321,27319,27318,27316,27315,27313,27311,27310,27308,27306,27305,27303,27301,27300,27298,27296,27295,27293,27291,27290,27288,27287,27285,27283,27282,27280,27278,27277,27275,27273,27272,27270,27268,27267,27265,27263,27262,27260,27259,27257,27255,27254,27252,27250,27249,27247,27245,27244,27242,27240,27239,27237,27236,27234,27232,27231,27229,27227,27226,27224,27222,27221,27219,27217,27216,27214,27212,27211,27209,27208,27206,27204,27203,27201,27199,27198,27196,27194,27193,27191,27189,27188,27186,27185,27183,27181,27180,27178,27176,27175,27173,27171,27170,27168,27166,27165,27163,27161,27160,27158,27157,27155,27153,27152,27150,27148,27147,27145,27143,27142,27140,27138,27137,27135,27134,27132,27130,27129,27127,27125,27124,27122,27120,27119,27117,27115,27114,27112,27111,27109,27107,27106,27104,27102,27101,27099,27097,27096,27094,27092,27091,27089,27088,27086,27084,27083,27081,27079,27078,27076,27074,27073,27071,27069,27068,27066,27064,27063,27061,27060,27058,27056,27055,27053,27051,27050,27048,27046,27045,27043,27041,27040,27038,27037,27035,27033,27032,27030,27028,27027,27025,27023,27022,27020,27018,27017,27015,27014,27012,27010,27009,27007,27005,27004,27002,27000,26999,26997,26995,26994,26992,26991,26989,26987,26986,26984,26982,26981,26979,26977,26976,26974,26972,26971,26969,26968,26966,26964,26963,26961,26959,26958,26956,26954,26953,26951,26949,26948,26946,26945,26943,26941,26940,26938,26936,26935,26933,26931,26930,26928,26926,26925,26923,26922,26920,26918,26917,26915,26913,26912,26910,26908,26907,26905,26903,26902,26900,26899,26897,26895,26894,26892,26890,26889,26887,26885,26884,26882,26880,26879,26877,26876,26874,26872,26871,26869,26867,26866,26864,26862,26861,26859,26857,26856,26854,26853,26851,26849,26848,26846,26844,26843,26841,26839,26838,26836,26834,26833,26831,26830,26828,26826,26825,26823,26821,26820,26818,26816,26815,26813,26811,26810,26808,26807,26805,26803,26802,26800,26798,26797,26795,26793,26792,26790,26789,26787,26785,26784,26782,26780,26779,26777,26775,26774,26772,26770,26769,26767,26766,26764,26762,26761,26759,26757,26756,26754,26752,26751,26749,26747,26746,26744,26743,26741,26739,26738,26736,26734,26733,26731,26729,26728,26726,26724,26723,26721,26720,26718,26716,26715,26713,26711,26710,26708,26706,26705,26703,26702,26700,26698,26697,26695,26693,26692,26690,26688,26687,26685,26683,26682,26680,26679,26677,26675,26674,26672,26670,26669,26667,26665,26664,26662,26660,26659,26657,26656,26654,26652,26651,26649,26647,26646,26644,26642,26641,26639,26638,26636,26634,26633,26631,26629,26628,26626,26624,26623,26621,26619,26618,26616,26615,26613,26611,26610,26608,26606,26605,26603,26601,26600,26598,26596,26595,26593,26592,26590,26588,26587,26585,26583,26582,26580,26578,26577,26575,26574,26572,26570,26569,26567,26565,26564,26562,26560,26559,26557,26555,26554,26552,26551,26549,26547,26546,26544,26542,26541,26539,26537,26536,26534,26533,26531,26529,26528,26526,26524,26523,26521,26519,26518,26516,26514,26513,26511,26510,26508,26506,26505,26503,26501,26500,26498,26496,26495,26493,26491,26490,26488,26487,26485,26483,26482,26480,26478,26477,26475,26473,26472,26470,26469,26467,26465,26464,26462,26460,26459,26457,26455,26454,26452,26450,26449,26447,26446,26444,26442,26441,26439,26437,26436,26434,26432,26431,26429,26428,26426,26424,26423,26421,26419,26418,26416,26414,26413,26411,26410,26408,26406,26405,26403,26401,26400,26398,26396,26395,26393,26391,26390,26388,26387,26385,26383,26382,26380,26378,26377,26375,26373,26372,26370,26369,26367,26365,26364,26362,26360,26359,26357,26355,26354,26352,26350,26349,26347,26346,26344,26342,26341,26339,26337,26336,26334,26332,26331,26329,26328,26326,26324,26323,26321,26319,26318,26316,26314,26313,26311,26309,26308,26306,26305,26303,26301,26300,26298,26296,26295,26293,26291,26290,26288,26287,26285,26283,26282,26280,26278,26277,26275,26273,26272,26270,26269,26267,26265,26264,26262,26260,26259,26257,26255,26254,26252,26250,26249,26247,26246,26244,26242,26241,26239,26237,26236,26234,26232,26231,26229,26228,26226,26224,26223,26221,26219,26218,26216,26214,26213,26211,26209,26208,26206,26205,26203,26201,26200,26198,26196,26195,26193,26191,26190,26188,26187,26185,26183,26182,26180,26178,26177,26175,26173,26172,26170,26169,26167,26165,26164,26162,26160,26159,26157,26155,26154,26152,26150,26149,26147,26146,26144,26142,26141,26139,26137,26136,26134,26132,26131,26129,26128,26126,26124,26123,26121,26119,26118,26116,26114,26113,26111,26110,26108,26106,26105,26103,26101,26100,26098,26096,26095,26093,26091,26090,26088,26087,26085,26083,26082,26080,26078,26077,26075,26073,26072,26070,26069,26067,26065,26064,26062,26060,26059,26057,26055,26054,26052,26051,26049,26047,26046,26044,26042,26041,26039,26037,26036,26034,26032,26031,26029,26028,26026,26024,26023,26021,26019,26018,26016,26014,26013,26011,26010,26008,26006,26005,26003,26001,26000,25998,25996,25995,25993,25992,25990,25988,25987,25985,25983,25982,25980,25978,25977,25975,25974,25972,25970,25969,25967,25965,25964,25962,25960,25959,25957,25955,25954,25952,25951,25949,25947,25946,25944,25942,25941,25939,25937,25936,25934,25933,25931,25929,25928,25926,25924,25923,25921,25919,25918,25916,25915,25913,25911,25910,25908,25906,25905,25903,25901,25900,25898,25896,25895,25893,25892,25890,25888,25887,25885,25883,25882,25880,25878,25877,25875,25874,25872,25870,25869,25867,25865,25864,25862,25860,25859,25857,25856,25854,25852,25851,25849,25847,25846,25844,25842,25841,25839,25838,25836,25834,25833,25831,25829,25828,25826,25824,25823,25821,25819,25818,25816,25815,25813,25811,25810,25808,25806,25805,25803,25801,25800,25798,25797,25795,25793,25792,25790,25788,25787,25785,25783,25782,25780,25779,25777,25775,25774,25772,25770,25769,25767,25765,25764,25762,25761,25759,25757,25756,25754,25752,25751,25749,25747,25746,25744,25742,25741,25739,25738,25736,25734,25733,25731,25729,25728,25726,25724,25723,25721,25720,25718,25716,25715,25713,25711,25710,25708,25706,25705,25703,25702,25700,25698,25697,25695,25693,25692,25690,25688,25687,25685,25683,25682,25680,25679,25677,25675,25674,25672,25670,25669,25667,25665,25664,25662,25661,25659,25657,25656,25654,25652,25651,25649,25647,25646,25644,25643,25641,25639,25638,25636,25634,25633,25631,25629,25628,25626,25625,25623,25621,25620,25618,25616,25615,25613,25611,25610,25608,25606,25605,25603,25602,25600,25598,25597,25595,25593,25592,25590,25588,25587,25585,25584,25582,25580,25579,25577,25575,25574,25572,25570,25569,25567,25566,25564,25562,25561,25559,25557,25556,25554,25552,25551,25549,25548,25546,25544,25543,25541,25539,25538,25536,25534,25533,25531,25529,25528,25526,25525,25523,25521,25520,25518,25516,25515,25513,25511,25510,25508,25507,25505,25503,25502,25500,25498,25497,25495,25493,25492,25490,25489,25487,25485,25484,25482,25480,25479,25477,25475,25474,25472,25470,25469,25467,25466,25464,25462,25461,25459,25457,25456,25454,25452,25451,25449,25448,25446,25444,25443,25441,25439,25438,25436,25434,25433,25431,25430,25428,25426,25425,25423,25421,25420,25418,25416,25415,25413,25412,25410,25408,25407,25405,25403,25402,25400,25398,25397,25395,25393,25392,25390,25389,25387,25385,25384,25382,25380,25379,25377,25375,25374,25372,25371,25369,25367,25366,25364,25362,25361,25359,25357,25356,25354,25353,25351,25349,25348,25346,25344,25343,25341,25339,25338,25336,25334,25333,25331,25330,25328,25326,25325,25323,25321,25320,25318,25316,25315,25313,25312,25310,25308,25307,25305,25303,25302,25300,25298,25297,25295,25294,25292,25290,25289,25287,25285,25284,25282,25280,25279,25277,25275,25274,25272,25271,25269,25267,25266,25264,25262,25261,25259,25257,25256,25254,25253,25251,25249,25248,25246,25244,25243,25241,25239,25238,25236,25234,25233,25231,25230,25228,25226,25225,25223,25221,25220,25218,25216,25215,25213,25212,25210,25208,25207,25205,25203,25202,25200,25198,25197,25195,25194,25192,25190,25189,25187,25185,25184,25182,25180,25179,25177,25175,25174,25172,25171,25169,25167,25166,25164,25162,25161,25159,25157,25156,25154,25153,25151,25149,25148,25146,25144,25143,25141,25139,25138,25136,25135,25133,25131,25130,25128,25126,25125,25123,25121,25120,25118,25116,25115,25113,25112,25110,25108,25107,25105,25103,25102,25100,25098,25097,25095,25094,25092,25090,25089,25087,25085,25084,25082,25080,25079,25077,25075,25074,25072,25071,25069,25067,25066,25064,25062,25061,25059,25057,25056,25054,25053,25051,25049,25048,25046,25044,25043,25041,25039,25038,25036,25034,25033,25031,25030,25028,25026,25025,25023,25021,25020,25018,25016,25015,25013,25012,25010,25008,25007,25005,25003,25002,25000,24998,24997,24995,24993,24992,24990,24989,24987,24985,24984,24982,24980,24979,24977,24975,24974,24972,24971,24969,24967,24966,24964,24962,24961,24959,24957,24956,24954,24952,24951,24949,24948,24946,24944,24943,24941,24939,24938,24936,24934,24933,24931,24930,24928,24926,24925,24923,24921,24920,24918,24916,24915,24913,24911,24910,24908,24907,24905,24903,24902,24900,24898,24897,24895,24893,24892,24890,24888,24887,24885,24884,24882,24880,24879,24877,24875,24874,24872,24870,24869,24867,24866,24864,24862,24861,24859,24857,24856,24854,24852,24851,24849,24847,24846,24844,24843,24841,24839,24838,24836,24834,24833,24831,24829,24828,24826,24825,24823,24821,24820,24818,24816,24815,24813,24811,24810,24808,24806,24805,24803,24802,24800,24798,24797,24795,24793,24792,24790,24788,24787,24785,24783,24782,24780,24779,24777,24775,24774,24772,24770,24769,24767,24765,24764,24762,24761,24759,24757,24756,24754,24752,24751,24749,24747,24746,24744,24742,24741,24739,24738,24736,24734,24733,24731,24729,24728,24726,24724,24723,24721,24719,24718,24716,24715,24713,24711,24710,24708,24706,24705,24703,24701,24700,24698,24696,24695,24693,24692,24690,24688,24687,24685,24683,24682,24680,24678,24677,24675,24674,24672,24670,24669,24667,24665,24664,24662,24660,24659,24657,24655,24654,24652,24651,24649,24647,24646,24644,24642,24641,24639,24637,24636,24634,24632,24631,24629,24628,24626,24624,24623,24621,24619,24618,24616,24614,24613,24611,24609,24608,24606,24605,24603,24601,24600,24598,24596,24595,24593,24591,24590,24588,24586,24585,24583,24582,24580,24578,24577,24575,24573,24572,24570,24568,24567,24565,24563,24562,24560,24559,24557,24555,24554,24552,24550,24549,24547,24545,24544,24542,24540,24539,24537,24536,24534,24532,24531,24529,24527,24526,24524,24522,24521,24519,24517,24516,24514,24513,24511,24509,24508,24506,24504,24503,24501,24499,24498,24496,24494,24493,24491,24490,24488,24486,24485,24483,24481,24480,24478,24476,24475,24473,24471,24470,24468,24467,24465,24463,24462,24460,24458,24457,24455,24453,24452,24450,24448,24447,24445,24444,24442,24440,24439,24437,24435,24434,24432,24430,24429,24427,24425,24424,24422,24421,24419,24417,24416,24414,24412,24411,24409,24407,24406,24404,24402,24401,24399,24398,24396,24394,24393,24391,24389,24388,24386,24384,24383,24381,24379,24378,24376,24374,24373,24371,24370,24368,24366,24365,24363,24361,24360,24358,24356,24355,24353,24351,24350,24348,24347,24345,24343,24342,24340,24338,24337,24335,24333,24332,24330,24328,24327,24325,24324,24322,24320,24319,24317,24315,24314,24312,24310,24309,24307,24305,24304,24302,24300,24299,24297,24296,24294,24292,24291,24289,24287,24286,24284,24282,24281,24279,24277,24276,24274,24273,24271,24269,24268,24266,24264,24263,24261,24259,24258,24256,24254,24253,24251,24249,24248,24246,24245,24243,24241,24240,24238,24236,24235,24233,24231,24230,24228,24226,24225,24223,24222,24220,24218,24217,24215,24213,24212,24210,24208,24207,24205,24203,24202,24200,24198,24197,24195,24194,24192,24190,24189,24187,24185,24184,24182,24180,24179,24177,24175,24174,24172,24171,24169,24167,24166,24164,24162,24161,24159,24157,24156,24154,24152,24151,24149,24147,24146,24144,24143,24141,24139,24138,24136,24134,24133,24131,24129,24128,24126,24124,24123,24121,24119,24118,24116,24115,24113,24111,24110,24108,24106,24105,24103,24101,24100,24098,24096,24095,24093,24091,24090,24088,24087,24085,24083,24082,24080,24078,24077,24075,24073,24072,24070,24068,24067,24065,24063,24062,24060,24059,24057,24055,24054,24052,24050,24049,24047,24045,24044,24042,24040,24039,24037,24035,24034,24032,24031,24029,24027,24026,24024,24022,24021,24019,24017,24016,24014,24012,24011,24009,24007,24006,24004,24003,24001,23999,23998,23996,23994,23993,23991,23989,23988,23986,23984,23983,23981,23979,23978,23976,23975,23973,23971,23970,23968,23966,23965,23963,23961,23960,23958,23956,23955,23953,23951,23950,23948,23947,23945,23943,23942,23940,23938,23937,23935,23933,23932,23930,23928,23927,23925,23923,23922,23920,23918,23917,23915,23914,23912,23910,23909,23907,23905,23904,23902,23900,23899,23897,23895,23894,23892,23890,23889,23887,23886,23884,23882,23881,23879,23877,23876,23874,23872,23871,23869,23867,23866,23864,23862,23861,23859,23857,23856,23854,23853,23851,23849,23848,23846,23844,23843,23841,23839,23838,23836,23834,23833,23831,23829,23828,23826,23824,23823,23821,23820,23818,23816,23815,23813,23811,23810,23808,23806,23805,23803,23801,23800,23798,23796,23795,23793,23792,23790,23788,23787,23785,23783,23782,23780,23778,23777,23775,23773,23772,23770,23768,23767,23765,23763,23762,23760,23758,23757,23755,23754,23752,23750,23749,23747,23745,23744,23742,23740,23739,23737,23735,23734,23732,23730,23729,23727,23725,23724,23722,23721,23719,23717,23716,23714,23712,23711,23709,23707,23706,23704,23702,23701,23699,23697,23696,23694,23692,23691,23689,23688,23686,23684,23683,23681,23679,23678,23676,23674,23673,23671,23669,23668,23666,23664,23663,23661,23659,23658,23656,23654,23653,23651,23650,23648,23646,23645,23643,23641,23640,23638,23636,23635,23633,23631,23630,23628,23626,23625,23623,23621,23620,23618,23616,23615,23613,23612,23610,23608,23607,23605,23603,23602,23600,23598,23597,23595,23593,23592,23590,23588,23587,23585,23583,23582,23580,23578,23577,23575,23574,23572,23570,23569,23567,23565,23564,23562,23560,23559,23557,23555,23554,23552,23550,23549,23547,23545,23544,23542,23540,23539,23537,23536,23534,23532,23531,23529,23527,23526,23524,23522,23521,23519,23517,23516,23514,23512,23511,23509,23507,23506,23504,23502,23501,23499,23497,23496,23494,23493,23491,23489,23488,23486,23484,23483,23481,23479,23478,23476,23474,23473,23471,23469,23468,23466,23464,23463,23461,23459,23458,23456,23454,23453,23451,23449,23448,23446,23445,23443,23441,23440,23438,23436,23435,23433,23431,23430,23428,23426,23425,23423,23421,23420,23418,23416,23415,23413,23411,23410,23408,23406,23405,23403,23402,23400,23398,23397,23395,23393,23392,23390,23388,23387,23385,23383,23382,23380,23378,23377,23375,23373,23372,23370,23368,23367,23365,23363,23362,23360,23358,23357,23355,23353,23352,23350,23349,23347,23345,23344,23342,23340,23339,23337,23335,23334,23332,23330,23329,23327,23325,23324,23322,23320,23319,23317,23315,23314,23312,23310,23309,23307,23305,23304,23302,23300,23299,23297,23296,23294,23292,23291,23289,23287,23286,23284,23282,23281,23279,23277,23276,23274,23272,23271,23269,23267,23266,23264,23262,23261,23259,23257,23256,23254,23252,23251,23249,23247,23246,23244,23242,23241,23239,23238,23236,23234,23233,23231,23229,23228,23226,23224,23223,23221,23219,23218,23216,23214,23213,23211,23209,23208,23206,23204,23203,23201,23199,23198,23196,23194,23193,23191,23189,23188,23186,23184,23183,23181,23179,23178,23176,23175,23173,23171,23170,23168,23166,23165,23163,23161,23160,23158,23156,23155,23153,23151,23150,23148,23146,23145,23143,23141,23140,23138,23136,23135,23133,23131,23130,23128,23126,23125,23123,23121,23120,23118,23116,23115,23113,23111,23110,23108,23106,23105,23103,23102,23100,23098,23097,23095,23093,23092,23090,23088,23087,23085,23083,23082,23080,23078,23077,23075,23073,23072,23070,23068,23067,23065,23063,23062,23060,23058,23057,23055,23053,23052,23050,23048,23047,23045,23043,23042,23040,23038,23037,23035,23033,23032,23030,23028,23027,23025,23023,23022,23020,23018,23017,23015,23014,23012,23010,23009,23007,23005,23004,23002,23000,22999,22997,22995,22994,22992,22990,22989,22987,22985,22984,22982,22980,22979,22977,22975,22974,22972,22970,22969,22967,22965,22964,22962,22960,22959,22957,22955,22954,22952,22950,22949,22947,22945,22944,22942,22940,22939,22937,22935,22934,22932,22930,22929,22927,22925,22924,22922,22920,22919,22917,22915,22914,22912,22910,22909,22907,22905,22904,22902,22900,22899,22897,22895,22894,22892,22890,22889,22887,22885,22884,22882,22881,22879,22877,22876,22874,22872,22871,22869,22867,22866,22864,22862,22861,22859,22857,22856,22854,22852,22851,22849,22847,22846,22844,22842,22841,22839,22837,22836,22834,22832,22831,22829,22827,22826,22824,22822,22821,22819,22817,22816,22814,22812,22811,22809,22807,22806,22804,22802,22801,22799,22797,22796,22794,22792,22791,22789,22787,22786,22784,22782,22781,22779,22777,22776,22774,22772,22771,22769,22767,22766,22764,22762,22761,22759,22757,22756,22754,22752,22751,22749,22747,22746,22744,22742,22741,22739,22737,22736,22734,22732,22731,22729,22727,22726,22724,22722,22721,22719,22717,22716,22714,22712,22711,22709,22707,22706,22704,22702,22701,22699,22697,22696,22694,22692,22691,22689,22687,22686,22684,22682,22681,22679,22677,22676,22674,22672,22671,22669,22667,22666,22664,22662,22661,22659,22657,22656,22654,22652,22651,22649,22647,22646,22644,22642,22641,22639,22637,22636,22634,22632,22631,22629,22627,22626,22624,22622,22621,22619,22617,22616,22614,22612,22611,22609,22607,22606,22604,22602,22601,22599,22597,22596,22594,22592,22591,22589,22587,22586,22584,22582,22581,22579,22577,22576,22574,22572,22571,22569,22567,22566,22564,22562,22561,22559,22557,22556,22554,22552,22551,22549,22547,22545,22544,22542,22540,22539,22537,22535,22534,22532,22530,22529,22527,22525,22524,22522,22520,22519,22517,22515,22514,22512,22510,22509,22507,22505,22504,22502,22500,22499,22497,22495,22494,22492,22490,22489,22487,22485,22484,22482,22480,22479,22477,22475,22474,22472,22470,22469,22467,22465,22464,22462,22460,22459,22457,22455,22454,22452,22450,22449,22447,22445,22444,22442,22440,22439,22437,22435,22434,22432,22430,22429,22427,22425,22424,22422,22420,22418,22417,22415,22413,22412,22410,22408,22407,22405,22403,22402,22400,22398,22397,22395,22393,22392,22390,22388,22387,22385,22383,22382,22380,22378,22377,22375,22373,22372,22370,22368,22367,22365,22363,22362,22360,22358,22357,22355,22353,22352,22350,22348,22347,22345,22343,22342,22340,22338,22336,22335,22333,22331,22330,22328,22326,22325,22323,22321,22320,22318,22316,22315,22313,22311,22310,22308,22306,22305,22303,22301,22300,22298,22296,22295,22293,22291,22290,22288,22286,22285,22283,22281,22280,22278,22276,22275,22273,22271,22269,22268,22266,22264,22263,22261,22259,22258,22256,22254,22253,22251,22249,22248,22246,22244,22243,22241,22239,22238,22236,22234,22233,22231,22229,22228,22226,22224,22223,22221,22219,22218,22216,22214,22212,22211,22209,22207,22206,22204,22202,22201,22199,22197,22196,22194,22192,22191,22189,22187,22186,22184,22182,22181,22179,22177,22176,22174,22172,22171,22169,22167,22166,22164,22162,22160,22159,22157,22155,22154,22152,22150,22149,22147,22145,22144,22142,22140,22139,22137,22135,22134,22132,22130,22129,22127,22125,22124,22122,22120,22119,22117,22115,22113,22112,22110,22108,22107,22105,22103,22102,22100,22098,22097,22095,22093,22092,22090,22088,22087,22085,22083,22082,22080,22078,22077,22075,22073,22071,22070,22068,22066,22065,22063,22061,22060,22058,22056,22055,22053,22051,22050,22048,22046,22045,22043,22041,22040,22038,22036,22035,22033,22031,22029,22028,22026,22024,22023,22021,22019,22018,22016,22014,22013,22011,22009,22008,22006,22004,22003,22001,21999,21998,21996,21994,21992,21991,21989,21987,21986,21984,21982,21981,21979,21977,21976,21974,21972,21971,21969,21967,21966,21964,21962,21960,21959,21957,21955,21954,21952,21950,21949,21947,21945,21944,21942,21940,21939,21937,21935,21934,21932,21930,21929,21927,21925,21923,21922,21920,21918,21917,21915,21913,21912,21910,21908,21907,21905,21903,21902,21900,21898,21897,21895,21893,21891,21890,21888,21886,21885,21883,21881,21880,21878,21876,21875,21873,21871,21870,21868,21866,21865,21863,21861,21859,21858,21856,21854,21853,21851,21849,21848,21846,21844,21843,21841,21839,21838,21836,21834,21832,21831,21829,21827,21826,21824,21822,21821,21819,21817,21816,21814,21812,21811,21809,21807,21805,21804,21802,21800,21799,21797,21795,21794,21792,21790,21789,21787,21785,21784,21782,21780,21779,21777,21775,21773,21772,21770,21768,21767,21765,21763,21762,21760,21758,21757,21755,21753,21752,21750,21748,21746,21745,21743,21741,21740,21738,21736,21735,21733,21731,21730,21728,21726,21724,21723,21721,21719,21718,21716,21714,21713,21711,21709,21708,21706,21704,21703,21701,21699,21697,21696,21694,21692,21691,21689,21687,21686,21684,21682,21681,21679,21677,21675,21674,21672,21670,21669,21667,21665,21664,21662,21660,21659,21657,21655,21654,21652,21650,21648,21647,21645,21643,21642,21640,21638,21637,21635,21633,21632,21630,21628,21626,21625,21623,21621,21620,21618,21616,21615,21613,21611,21610,21608,21606,21604,21603,21601,21599,21598,21596,21594,21593,21591,21589,21588,21586,21584,21582,21581,21579,21577,21576,21574,21572,21571,21569,21567,21566,21564,21562,21560,21559,21557,21555,21554,21552,21550,21549,21547,21545,21544,21542,21540,21538,21537,21535,21533,21532,21530,21528,21527,21525,21523,21522,21520,21518,21516,21515,21513,21511,21510,21508,21506,21505,21503,21501,21499,21498,21496,21494,21493,21491,21489,21488,21486,21484,21483,21481,21479,21477,21476,21474,21472,21471,21469,21467,21466,21464,21462,21460,21459,21457,21455,21454,21452,21450,21449,21447,21445,21444,21442,21440,21438,21437,21435,21433,21432,21430,21428,21427,21425,21423,21421,21420,21418,21416,21415,21413,21411,21410,21408,21406,21405,21403,21401,21399,21398,21396,21394,21393,21391,21389,21388,21386,21384,21382,21381,21379,21377,21376,21374,21372,21371,21369,21367,21365,21364,21362,21360,21359,21357,21355,21354,21352,21350,21348,21347,21345,21343,21342,21340,21338,21337,21335,21333,21331,21330,21328,21326,21325,21323,21321,21320,21318,21316,21314,21313,21311,21309,21308,21306,21304,21303,21301,21299,21297,21296,21294,21292,21291,21289,21287,21286,21284,21282,21280,21279,21277,21275,21274,21272,21270,21269,21267,21265,21263,21262,21260,21258,21257,21255,21253,21252,21250,21248,21246,21245,21243,21241,21240,21238,21236,21235,21233,21231,21229,21228,21226,21224,21223,21221,21219,21218,21216,21214,21212,21211,21209,21207,21206,21204,21202,21200,21199,21197,21195,21194,21192,21190,21189,21187,21185,21183,21182,21180,21178,21177,21175,21173,21172,21170,21168,21166,21165,21163,21161,21160,21158,21156,21154,21153,21151,21149,21148,21146,21144,21143,21141,21139,21137,21136,21134,21132,21131,21129,21127,21125,21124,21122,21120,21119,21117,21115,21114,21112,21110,21108,21107,21105,21103,21102,21100,21098,21096,21095,21093,21091,21090,21088,21086,21085,21083,21081,21079,21078,21076,21074,21073,21071,21069,21067,21066,21064,21062,21061,21059,21057,21056,21054,21052,21050,21049,21047,21045,21044,21042,21040,21038,21037,21035,21033,21032,21030,21028,21026,21025,21023,21021,21020,21018,21016,21015,21013,21011,21009,21008,21006,21004,21003,21001,20999,20997,20996,20994,20992,20991,20989,20987,20985,20984,20982,20980,20979,20977,20975,20973,20972,20970,20968,20967,20965,20963,20962,20960,20958,20956,20955,20953,20951,20950,20948,20946,20944,20943,20941,20939,20938,20936,20934,20932,20931,20929,20927,20926,20924,20922,20920,20919,20917,20915,20914,20912,20910,20908,20907,20905,20903,20902,20900,20898,20896,20895,20893,20891,20890,20888,20886,20884,20883,20881,20879,20878,20876,20874,20872,20871,20869,20867,20866,20864,20862,20861,20859,20857,20855,20854,20852,20850,20849,20847,20845,20843,20842,20840,20838,20837,20835,20833,20831,20830,20828,20826,20825,20823,20821,20819,20818,20816,20814,20812,20811,20809,20807,20806,20804,20802,20800,20799,20797,20795,20794,20792,20790,20788,20787,20785,20783,20782,20780,20778,20776,20775,20773,20771,20770,20768,20766,20764,20763,20761,20759,20758,20756,20754,20752,20751,20749,20747,20746,20744,20742,20740,20739,20737,20735,20734,20732,20730,20728,20727,20725,20723,20722,20720,20718,20716,20715,20713,20711,20709,20708,20706,20704,20703,20701,20699,20697,20696,20694,20692,20691,20689,20687,20685,20684,20682,20680,20679,20677,20675,20673,20672,20670,20668,20666,20665,20663,20661,20660,20658,20656,20654,20653,20651,20649,20648,20646,20644,20642,20641,20639,20637,20636,20634,20632,20630,20629,20627,20625,20623,20622,20620,20618,20617,20615,20613,20611,20610,20608,20606,20605,20603,20601,20599,20598,20596,20594,20592,20591,20589,20587,20586,20584,20582,20580,20579,20577,20575,20574,20572,20570,20568,20567,20565,20563,20561,20560,20558,20556,20555,20553,20551,20549,20548,20546,20544,20543,20541,20539,20537,20536,20534,20532,20530,20529,20527,20525,20524,20522,20520,20518,20517,20515,20513,20511,20510,20508,20506,20505,20503,20501,20499,20498,20496,20494,20492,20491,20489,20487,20486,20484,20482,20480,20479,20477,20475,20473,20472,20470,20468,20467,20465,20463,20461,20460,20458,20456,20454,20453,20451,20449,20448,20446,20444,20442,20441,20439,20437,20435,20434,20432,20430,20429,20427,20425,20423,20422,20420,20418,20416,20415,20413,20411,20410,20408,20406,20404,20403,20401,20399,20397,20396,20394,20392,20391,20389,20387,20385,20384,20382,20380,20378,20377,20375,20373,20371,20370,20368,20366,20365,20363,20361,20359,20358,20356,20354,20352,20351,20349,20347,20346,20344,20342,20340,20339,20337,20335,20333,20332,20330,20328,20326,20325,20323,20321,20320,20318,20316,20314,20313,20311,20309,20307,20306,20304,20302,20301,20299,20297,20295,20294,20292,20290,20288,20287,20285,20283,20281,20280,20278,20276,20275,20273,20271,20269,20268,20266,20264,20262,20261,20259,20257,20255,20254,20252,20250,20248,20247,20245,20243,20242,20240,20238,20236,20235,20233,20231,20229,20228,20226,20224,20222,20221,20219,20217,20216,20214,20212,20210,20209,20207,20205,20203,20202,20200,20198,20196,20195,20193,20191,20189,20188,20186,20184,20183,20181,20179,20177,20176,20174,20172,20170,20169,20167,20165,20163,20162,20160,20158,20156,20155,20153,20151,20149,20148,20146,20144,20143,20141,20139,20137,20136,20134,20132,20130,20129,20127,20125,20123,20122,20120,20118,20116,20115,20113,20111,20109,20108,20106,20104,20103,20101,20099,20097,20096,20094,20092,20090,20089,20087,20085,20083,20082,20080,20078,20076,20075,20073,20071,20069,20068,20066,20064,20062,20061,20059,20057,20056,20054,20052,20050,20049,20047,20045,20043,20042,20040,20038,20036,20035,20033,20031,20029,20028,20026,20024,20022,20021,20019,20017,20015,20014,20012,20010,20008,20007,20005,20003,20001,20000,19998,19996,19995,19993,19991,19989,19988,19986,19984,19982,19981,19979,19977,19975,19974,19972,19970,19968,19967,19965,19963,19961,19960,19958,19956,19954,19953,19951,19949,19947,19946,19944,19942,19940,19939,19937,19935,19933,19932,19930,19928,19926,19925,19923,19921,19919,19918,19916,19914,19912,19911,19909,19907,19905,19904,19902,19900,19898,19897,19895,19893,19891,19890,19888,19886,19884,19883,19881,19879,19877,19876,19874,19872,19870,19869,19867,19865,19863,19862,19860,19858,19856,19855,19853,19851,19849,19848,19846,19844,19842,19841,19839,19837,19835,19834,19832,19830,19828,19827,19825,19823,19821,19820,19818,19816,19814,19813,19811,19809,19807,19806,19804,19802,19800,19799,19797,19795,19793,19792,19790,19788,19786,19785,19783,19781,19779,19778,19776,19774,19772,19771,19769,19767,19765,19764,19762,19760,19758,19757,19755,19753,19751,19750,19748,19746,19744,19743,19741,19739,19737,19736,19734,19732,19730,19729,19727,19725,19723,19722,19720,19718,19716,19715,19713,19711,19709,19707,19706,19704,19702,19700,19699,19697,19695,19693,19692,19690,19688,19686,19685,19683,19681,19679,19678,19676,19674,19672,19671,19669,19667,19665,19664,19662,19660,19658,19657,19655,19653,19651,19650,19648,19646,19644,19642,19641,19639,19637,19635,19634,19632,19630,19628,19627,19625,19623,19621,19620,19618,19616,19614,19613,19611,19609,19607,19606,19604,19602,19600,19598,19597,19595,19593,19591,19590,19588,19586,19584,19583,19581,19579,19577,19576,19574,19572,19570,19569,19567,19565,19563,19562,19560,19558,19556,19554,19553,19551,19549,19547,19546,19544,19542,19540,19539,19537,19535,19533,19532,19530,19528,19526,19524,19523,19521,19519,19517,19516,19514,19512,19510,19509,19507,19505,19503,19502,19500,19498,19496,19494,19493,19491,19489,19487,19486,19484,19482,19480,19479,19477,19475,19473,19472,19470,19468,19466,19464,19463,19461,19459,19457,19456,19454,19452,19450,19449,19447,19445,19443,19442,19440,19438,19436,19434,19433,19431,19429,19427,19426,19424,19422,19420,19419,19417,19415,19413,19411,19410,19408,19406,19404,19403,19401,19399,19397,19396,19394,19392,19390,19388,19387,19385,19383,19381,19380,19378,19376,19374,19373,19371,19369,19367,19365,19364,19362,19360,19358,19357,19355,19353,19351,19350,19348,19346,19344,19342,19341,19339,19337,19335,19334,19332,19330,19328,19326,19325,19323,19321,19319,19318,19316,19314,19312,19311,19309,19307,19305,19303,19302,19300,19298,19296,19295,19293,19291,19289,19287,19286,19284,19282,19280,19279,19277,19275,19273,19271,19270,19268,19266,19264,19263,19261,19259,19257,19256,19254,19252,19250,19248,19247,19245,19243,19241,19240,19238,19236,19234,19232,19231,19229,19227,19225,19224,19222,19220,19218,19216,19215,19213,19211,19209,19208,19206,19204,19202,19200,19199,19197,19195,19193,19192,19190,19188,19186,19184,19183,19181,19179,19177,19176,19174,19172,19170,19168,19167,19165,19163,19161,19160,19158,19156,19154,19152,19151,19149,19147,19145,19144,19142,19140,19138,19136,19135,19133,19131,19129,19127,19126,19124,19122,19120,19119,19117,19115,19113,19111,19110,19108,19106,19104,19103,19101,19099,19097,19095,19094,19092,19090,19088,19086,19085,19083,19081,19079,19078,19076,19074,19072,19070,19069,19067,19065,19063,19062,19060,19058,19056,19054,19053,19051,19049,19047,19045,19044,19042,19040,19038,19037,19035,19033,19031,19029,19028,19026,19024,19022,19020,19019,19017,19015,19013,19012,19010,19008,19006,19004,19003,19001,18999,18997,18995,18994,18992,18990,18988,18986,18985,18983,18981,18979,18978,18976,18974,18972,18970,18969,18967,18965,18963,18961,18960,18958,18956,18954,18952,18951,18949,18947,18945,18944,18942,18940,18938,18936,18935,18933,18931,18929,18927,18926,18924,18922,18920,18918,18917,18915,18913,18911,18910,18908,18906,18904,18902,18901,18899,18897,18895,18893,18892,18890,18888,18886,18884,18883,18881,18879,18877,18875,18874,18872,18870,18868,18866,18865,18863,18861,18859,18858,18856,18854,18852,18850,18849,18847,18845,18843,18841,18840,18838,18836,18834,18832,18831,18829,18827,18825,18823,18822,18820,18818,18816,18814,18813,18811,18809,18807,18805,18804,18802,18800,18798,18796,18795,18793,18791,18789,18787,18786,18784,18782,18780,18778,18777,18775,18773,18771,18770,18768,18766,18764,18762,18761,18759,18757,18755,18753,18752,18750,18748,18746,18744,18743,18741,18739,18737,18735,18734,18732,18730,18728,18726,18725,18723,18721,18719,18717,18716,18714,18712,18710,18708,18707,18705,18703,18701,18699,18697,18696,18694,18692,18690,18688,18687,18685,18683,18681,18679,18678,18676,18674,18672,18670,18669,18667,18665,18663,18661,18660,18658,18656,18654,18652,18651,18649,18647,18645,18643,18642,18640,18638,18636,18634,18633,18631,18629,18627,18625,18624,18622,18620,18618,18616,18614,18613,18611,18609,18607,18605,18604,18602,18600,18598,18596,18595,18593,18591,18589,18587,18586,18584,18582,18580,18578,18577,18575,18573,18571,18569,18567,18566,18564,18562,18560,18558,18557,18555,18553,18551,18549,18548,18546,18544,18542,18540,18539,18537,18535,18533,18531,18529,18528,18526,18524,18522,18520,18519,18517,18515,18513,18511,18510,18508,18506,18504,18502,18501,18499,18497,18495,18493,18491,18490,18488,18486,18484,18482,18481,18479,18477,18475,18473,18472,18470,18468,18466,18464,18462,18461,18459,18457,18455,18453,18452,18450,18448,18446,18444,18442,18441,18439,18437,18435,18433,18432,18430,18428,18426,18424,18422,18421,18419,18417,18415,18413,18412,18410,18408,18406,18404,18403,18401,18399,18397,18395,18393,18392,18390,18388,18386,18384,18383,18381,18379,18377,18375,18373,18372,18370,18368,18366,18364,18363,18361,18359,18357,18355,18353,18352,18350,18348,18346,18344,18342,18341,18339,18337,18335,18333,18332,18330,18328,18326,18324,18322,18321,18319,18317,18315,18313,18312,18310,18308,18306,18304,18302,18301,18299,18297,18295,18293,18291,18290,18288,18286,18284,18282,18281,18279,18277,18275,18273,18271,18270,18268,18266,18264,18262,18260,18259,18257,18255,18253,18251,18249,18248,18246,18244,18242,18240,18239,18237,18235,18233,18231,18229,18228,18226,18224,18222,18220,18218,18217,18215,18213,18211,18209,18207,18206,18204,18202,18200,18198,18197,18195,18193,18191,18189,18187,18186,18184,18182,18180,18178,18176,18175,18173,18171,18169,18167,18165,18164,18162,18160,18158,18156,18154,18153,18151,18149,18147,18145,18143,18142,18140,18138,18136,18134,18132,18131,18129,18127,18125,18123,18121,18120,18118,18116,18114,18112,18110,18109,18107,18105,18103,18101,18099,18098,18096,18094,18092,18090,18088,18087,18085,18083,18081,18079,18077,18076,18074,18072,18070,18068,18066,18065,18063,18061,18059,18057,18055,18054,18052,18050,18048,18046,18044,18043,18041,18039,18037,18035,18033,18032,18030,18028,18026,18024,18022,18020,18019,18017,18015,18013,18011,18009,18008,18006,18004,18002,18000,17998,17997,17995,17993,17991,17989,17987,17986,17984,17982,17980,17978,17976,17974,17973,17971,17969,17967,17965,17963,17962,17960,17958,17956,17954,17952,17951,17949,17947,17945,17943,17941,17939,17938,17936,17934,17932,17930,17928,17927,17925,17923,17921,17919,17917,17916,17914,17912,17910,17908,17906,17904,17903,17901,17899,17897,17895,17893,17892,17890,17888,17886,17884,17882,17880,17879,17877,17875,17873,17871,17869,17868,17866,17864,17862,17860,17858,17856,17855,17853,17851,17849,17847,17845,17844,17842,17840,17838,17836,17834,17832,17831,17829,17827,17825,17823,17821,17819,17818,17816,17814,17812,17810,17808,17807,17805,17803,17801,17799,17797,17795,17794,17792,17790,17788,17786,17784,17782,17781,17779,17777,17775,17773,17771,17769,17768,17766,17764,17762,17760,17758,17756,17755,17753,17751,17749,17747,17745,17744,17742,17740,17738,17736,17734,17732,17731,17729,17727,17725,17723,17721,17719,17718,17716,17714,17712,17710,17708,17706,17705,17703,17701,17699,17697,17695,17693,17692,17690,17688,17686,17684,17682,17680,17679,17677,17675,17673,17671,17669,17667,17666,17664,17662,17660,17658,17656,17654,17652,17651,17649,17647,17645,17643,17641,17639,17638,17636,17634,17632,17630,17628,17626,17625,17623,17621,17619,17617,17615,17613,17612,17610,17608,17606,17604,17602,17600,17598,17597,17595,17593,17591,17589,17587,17585,17584,17582,17580,17578,17576,17574,17572,17571,17569,17567,17565,17563,17561,17559,17557,17556,17554,17552,17550,17548,17546,17544,17543,17541,17539,17537,17535,17533,17531,17529,17528,17526,17524,17522,17520,17518,17516,17515,17513,17511,17509,17507,17505,17503,17501,17500,17498,17496,17494,17492,17490,17488,17486,17485,17483,17481,17479,17477,17475,17473,17472,17470,17468,17466,17464,17462,17460,17458,17457,17455,17453,17451,17449,17447,17445,17443,17442,17440,17438,17436,17434,17432,17430,17428,17427,17425,17423,17421,17419,17417,17415,17413,17412,17410,17408,17406,17404,17402,17400,17398,17397,17395,17393,17391,17389,17387,17385,17383,17382,17380,17378,17376,17374,17372,17370,17368,17367,17365,17363,17361,17359,17357,17355,17353,17351,17350,17348,17346,17344,17342,17340,17338,17336,17335,17333,17331,17329,17327,17325,17323,17321,17320,17318,17316,17314,17312,17310,17308,17306,17304,17303,17301,17299,17297,17295,17293,17291,17289,17288,17286,17284,17282,17280,17278,17276,17274,17272,17271,17269,17267,17265,17263,17261,17259,17257,17255,17254,17252,17250,17248,17246,17244,17242,17240,17239,17237,17235,17233,17231,17229,17227,17225,17223,17222,17220,17218,17216,17214,17212,17210,17208,17206,17205,17203,17201,17199,17197,17195,17193,17191,17189,17188,17186,17184,17182,17180,17178,17176,17174,17172,17171,17169,17167,17165,17163,17161,17159,17157,17155,17154,17152,17150,17148,17146,17144,17142,17140,17138,17136,17135,17133,17131,17129,17127,17125,17123,17121,17119,17118,17116,17114,17112,17110,17108,17106,17104,17102,17100,17099,17097,17095,17093,17091,17089,17087,17085,17083,17082,17080,17078,17076,17074,17072,17070,17068,17066,17064,17063,17061,17059,17057,17055,17053,17051,17049,17047,17045,17044,17042,17040,17038,17036,17034,17032,17030,17028,17026,17025,17023,17021,17019,17017,17015,17013,17011,17009,17007,17006,17004,17002,17000,16998,16996,16994,16992,16990,16988,16987,16985,16983,16981,16979,16977,16975,16973,16971,16969,16967,16966,16964,16962,16960,16958,16956,16954,16952,16950,16948,16947,16945,16943,16941,16939,16937,16935,16933,16931,16929,16927,16926,16924,16922,16920,16918,16916,16914,16912,16910,16908,16906,16905,16903,16901,16899,16897,16895,16893,16891,16889,16887,16885,16884,16882,16880,16878,16876,16874,16872,16870,16868,16866,16864,16863,16861,16859,16857,16855,16853,16851,16849,16847,16845,16843,16841,16840,16838,16836,16834,16832,16830,16828,16826,16824,16822,16820,16818,16817,16815,16813,16811,16809,16807,16805,16803,16801,16799,16797,16795,16794,16792,16790,16788,16786,16784,16782,16780,16778,16776,16774,16772,16771,16769,16767,16765,16763,16761,16759,16757,16755,16753,16751,16749,16748,16746,16744,16742,16740,16738,16736,16734,16732,16730,16728,16726,16724,16723,16721,16719,16717,16715,16713,16711,16709,16707,16705,16703,16701,16699,16698,16696,16694,16692,16690,16688,16686,16684,16682,16680,16678,16676,16674,16673,16671,16669,16667,16665,16663,16661,16659,16657,16655,16653,16651,16649,16647,16646,16644,16642,16640,16638,16636,16634,16632,16630,16628,16626,16624,16622,16621,16619,16617,16615,16613,16611,16609,16607,16605,16603,16601,16599,16597,16595,16593,16592,16590,16588,16586,16584,16582,16580,16578,16576,16574,16572,16570,16568,16566,16564,16563,16561,16559,16557,16555,16553,16551,16549,16547,16545,16543,16541,16539,16537,16535,16534,16532,16530,16528,16526,16524,16522,16520,16518,16516,16514,16512,16510,16508,16506,16504,16503,16501,16499,16497,16495,16493,16491,16489,16487,16485,16483,16481,16479,16477,16475,16473,16472,16470,16468,16466,16464,16462,16460,16458,16456,16454,16452,16450,16448,16446,16444,16442,16440,16439,16437,16435,16433,16431,16429,16427,16425,16423,16421,16419,16417,16415,16413,16411,16409,16407,16405,16404,16402,16400,16398,16396,16394,16392,16390,16388,16386,16384,16382,16380,16378,16376,16374,16372,16370,16368,16367,16365,16363,16361,16359,16357,16355,16353,16351,16349,16347,16345,16343,16341,16339,16337,16335,16333,16331,16329,16328,16326,16324,16322,16320,16318,16316,16314,16312,16310,16308,16306,16304,16302,16300,16298,16296,16294,16292,16290,16288,16287,16285,16283,16281,16279,16277,16275,16273,16271,16269,16267,16265,16263,16261,16259,16257,16255,16253,16251,16249,16247,16245,16243,16242,16240,16238,16236,16234,16232,16230,16228,16226,16224,16222,16220,16218,16216,16214,16212,16210,16208,16206,16204,16202,16200,16198,16196,16194,16193,16191,16189,16187,16185,16183,16181,16179,16177,16175,16173,16171,16169,16167,16165,16163,16161,16159,16157,16155,16153,16151,16149,16147,16145,16143,16141,16139,16138,16136,16134,16132,16130,16128,16126,16124,16122,16120,16118,16116,16114,16112,16110,16108,16106,16104,16102,16100,16098,16096,16094,16092,16090,16088,16086,16084,16082,16080,16078,16076,16075,16073,16071,16069,16067,16065,16063,16061,16059,16057,16055,16053,16051,16049,16047,16045,16043,16041,16039,16037,16035,16033,16031,16029,16027,16025,16023,16021,16019,16017,16015,16013,16011,16009,16007,16005,16003,16001,15999,15998,15996,15994,15992,15990,15988,15986,15984,15982,15980,15978,15976,15974,15972,15970,15968,15966,15964,15962,15960,15958,15956,15954,15952,15950,15948,15946,15944,15942,15940,15938,15936,15934,15932,15930,15928,15926,15924,15922,15920,15918,15916,15914,15912,15910,15908,15906,15904,15902,15900,15898,15896,15894,15892,15890,15888,15887,15885,15883,15881,15879,15877,15875,15873,15871,15869,15867,15865,15863,15861,15859,15857,15855,15853,15851,15849,15847,15845,15843,15841,15839,15837,15835,15833,15831,15829,15827,15825,15823,15821,15819,15817,15815,15813,15811,15809,15807,15805,15803,15801,15799,15797,15795,15793,15791,15789,15787,15785,15783,15781,15779,15777,15775,15773,15771,15769,15767,15765,15763,15761,15759,15757,15755,15753,15751,15749,15747,15745,15743,15741,15739,15737,15735,15733,15731,15729,15727,15725,15723,15721,15719,15717,15715,15713,15711,15709,15707,15705,15703,15701,15699,15697,15695,15693,15691,15689,15687,15685,15683,15681,15679,15677,15675,15673,15671,15669,15667,15665,15663,15661,15659,15657,15655,15653,15651,15649,15647,15645,15643,15641,15639,15637,15635,15633,15631,15629,15627,15625,15623,15621,15619,15617,15615,15613,15611,15609,15607,15605,15603,15601,15599,15597,15595,15593,15591,15589,15587,15585,15583,15581,15579,15577,15575,15573,15571,15568,15566,15564,15562,15560,15558,15556,15554,15552,15550,15548,15546,15544,15542,15540,15538,15536,15534,15532,15530,15528,15526,15524,15522,15520,15518,15516,15514,15512,15510,15508,15506,15504,15502,15500,15498,15496,15494,15492,15490,15488,15486,15484,15482,15480,15478,15476,15474,15472,15470,15468,15466,15464,15462,15459,15457,15455,15453,15451,15449,15447,15445,15443,15441,15439,15437,15435,15433,15431,15429,15427,15425,15423,15421,15419,15417,15415,15413,15411,15409,15407,15405,15403,15401,15399,15397,15395,15393,15391,15389,15387,15384,15382,15380,15378,15376,15374,15372,15370,15368,15366,15364,15362,15360,15358,15356,15354,15352,15350,15348,15346,15344,15342,15340,15338,15336,15334,15332,15330,15328,15326,15323,15321,15319,15317,15315,15313,15311,15309,15307,15305,15303,15301,15299,15297,15295,15293,15291,15289,15287,15285,15283,15281,15279,15277,15275,15273,15270,15268,15266,15264,15262,15260,15258,15256,15254,15252,15250,15248,15246,15244,15242,15240,15238,15236,15234,15232,15230,15228,15226,15224,15221,15219,15217,15215,15213,15211,15209,15207,15205,15203,15201,15199,15197,15195,15193,15191,15189,15187,15185,15183,15181,15178,15176,15174,15172,15170,15168,15166,15164,15162,15160,15158,15156,15154,15152,15150,15148,15146,15144,15142,15139,15137,15135,15133,15131,15129,15127,15125,15123,15121,15119,15117,15115,15113,15111,15109,15107,15105,15103,15100,15098,15096,15094,15092,15090,15088,15086,15084,15082,15080,15078,15076,15074,15072,15070,15068,15065,15063,15061,15059,15057,15055,15053,15051,15049,15047,15045,15043,15041,15039,15037,15035,15032,15030,15028,15026,15024,15022,15020,15018,15016,15014,15012,15010,15008,15006,15004,15001,14999,14997,14995,14993,14991,14989,14987,14985,14983,14981,14979,14977,14975,14973,14970,14968,14966,14964,14962,14960,14958,14956,14954,14952,14950,14948,14946,14944,14941,14939,14937,14935,14933,14931,14929,14927,14925,14923,14921,14919,14917,14915,14912,14910,14908,14906,14904,14902,14900,14898,14896,14894,14892,14890,14888,14885,14883,14881,14879,14877,14875,14873,14871,14869,14867,14865,14863,14861,14858,14856,14854,14852,14850,14848,14846,14844,14842,14840,14838,14836,14833,14831,14829,14827,14825,14823,14821,14819,14817,14815,14813,14811,14808,14806,14804,14802,14800,14798,14796,14794,14792,14790,14788,14786,14783,14781,14779,14777,14775,14773,14771,14769,14767,14765,14763,14760,14758,14756,14754,14752,14750,14748,14746,14744,14742,14740,14737,14735,14733,14731,14729,14727,14725,14723,14721,14719,14717,14714,14712,14710,14708,14706,14704,14702,14700,14698,14696,14693,14691,14689,14687,14685,14683,14681,14679,14677,14675,14672,14670,14668,14666,14664,14662,14660,14658,14656,14654,14651,14649,14647,14645,14643,14641,14639,14637,14635,14633,14630,14628,14626,14624,14622,14620,14618,14616,14614,14612,14609,14607,14605,14603,14601,14599,14597,14595,14593,14590,14588,14586,14584,14582,14580,14578,14576,14574,14571,14569,14567,14565,14563,14561,14559,14557,14555,14552,14550,14548,14546,14544,14542,14540,14538,14536,14533,14531,14529,14527,14525,14523,14521,14519,14517,14514,14512,14510,14508,14506,14504,14502,14500,14498,14495,14493,14491,14489,14487,14485,14483,14481,14478,14476,14474,14472,14470,14468,14466,14464,14461,14459,14457,14455,14453,14451,14449,14447,14444,14442,14440,14438,14436,14434,14432,14430,14428,14425,14423,14421,14419,14417,14415,14413,14411,14408,14406,14404,14402,14400,14398,14396,14393,14391,14389,14387,14385,14383,14381,14379,14376,14374,14372,14370,14368,14366,14364,14362,14359,14357,14355,14353,14351,14349,14347,14344,14342,14340,14338,14336,14334,14332,14330,14327,14325,14323,14321,14319,14317,14315,14312,14310,14308,14306,14304,14302,14300,14297,14295,14293,14291,14289,14287,14285,14282,14280,14278,14276,14274,14272,14270,14268,14265,14263,14261,14259,14257,14255,14253,14250,14248,14246,14244,14242,14240,14237,14235,14233,14231,14229,14227,14225,14222,14220,14218,14216,14214,14212,14210,14207,14205,14203,14201,14199,14197,14195,14192,14190,14188,14186,14184,14182,14179,14177,14175,14173,14171,14169,14167,14164,14162,14160,14158,14156,14154,14151,14149,14147,14145,14143,14141,14139,14136,14134,14132,14130,14128,14126,14123,14121,14119,14117,14115,14113,14110,14108,14106,14104,14102,14100,14098,14095,14093,14091,14089,14087,14085,14082,14080,14078,14076,14074,14072,14069,14067,14065,14063,14061,14059,14056,14054,14052,14050,14048,14046,14043,14041,14039,14037,14035,14033,14030,14028,14026,14024,14022,14020,14017,14015,14013,14011,14009,14007,14004,14002,14000,13998,13996,13994,13991,13989,13987,13985,13983,13980,13978,13976,13974,13972,13970,13967,13965,13963,13961,13959,13957,13954,13952,13950,13948,13946,13943,13941,13939,13937,13935,13933,13930,13928,13926,13924,13922,13919,13917,13915,13913,13911,13909,13906,13904,13902,13900,13898,13895,13893,13891,13889,13887,13885,13882,13880,13878,13876,13874,13871,13869,13867,13865,13863,13860,13858,13856,13854,13852,13850,13847,13845,13843,13841,13839,13836,13834,13832,13830,13828,13825,13823,13821,13819,13817,13814,13812,13810,13808,13806,13804,13801,13799,13797,13795,13793,13790,13788,13786,13784,13782,13779,13777,13775,13773,13771,13768,13766,13764,13762,13760,13757,13755,13753,13751,13749,13746,13744,13742,13740,13738,13735,13733,13731,13729,13727,13724,13722,13720,13718,13715,13713,13711,13709,13707,13704,13702,13700,13698,13696,13693,13691,13689,13687,13685,13682,13680,13678,13676,13674,13671,13669,13667,13665,13662,13660,13658,13656,13654,13651,13649,13647,13645,13643,13640,13638,13636,13634,13631,13629,13627,13625,13623,13620,13618,13616,13614,13611,13609,13607,13605,13603,13600,13598,13596,13594,13592,13589,13587,13585,13583,13580,13578,13576,13574,13572,13569,13567,13565,13563,13560,13558,13556,13554,13551,13549,13547,13545,13543,13540,13538,13536,13534,13531,13529,13527,13525,13523,13520,13518,13516,13514,13511,13509,13507,13505,13502,13500,13498,13496,13494,13491,13489,13487,13485,13482,13480,13478,13476,13473,13471,13469,13467,13464,13462,13460,13458,13456,13453,13451,13449,13447,13444,13442,13440,13438,13435,13433,13431,13429,13426,13424,13422,13420,13417,13415,13413,13411,13408,13406,13404,13402,13399,13397,13395,13393,13390,13388,13386,13384,13381,13379,13377,13375,13373,13370,13368,13366,13364,13361,13359,13357,13355,13352,13350,13348,13345,13343,13341,13339,13336,13334,13332,13330,13327,13325,13323,13321,13318,13316,13314,13312,13309,13307,13305,13303,13300,13298,13296,13294,13291,13289,13287,13285,13282,13280,13278,13276,13273,13271,13269,13266,13264,13262,13260,13257,13255,13253,13251,13248,13246,13244,13242,13239,13237,13235,13233,13230,13228,13226,13223,13221,13219,13217,13214,13212,13210,13208,13205,13203,13201,13198,13196,13194,13192,13189,13187,13185,13183,13180,13178,13176,13173,13171,13169,13167,13164,13162,13160,13158,13155,13153,13151,13148,13146,13144,13142,13139,13137,13135,13132,13130,13128,13126,13123,13121,13119,13116,13114,13112,13110,13107,13105,13103,13101,13098,13096,13094,13091,13089,13087,13084,13082,13080,13078,13075,13073,13071,13068,13066,13064,13062,13059,13057,13055,13052,13050,13048,13046,13043,13041,13039,13036,13034,13032,13030,13027,13025,13023,13020,13018,13016,13013,13011,13009,13007,13004,13002,13000,12997,12995,12993,12990,12988,12986,12984,12981,12979,12977,12974,12972,12970,12967,12965,12963,12961,12958,12956,12954,12951,12949,12947,12944,12942,12940,12937,12935,12933,12931,12928,12926,12924,12921,12919,12917,12914,12912,12910,12907,12905,12903,12901,12898,12896,12894,12891,12889,12887,12884,12882,12880,12877,12875,12873,12870,12868,12866,12863,12861,12859,12857,12854,12852,12850,12847,12845,12843,12840,12838,12836,12833,12831,12829,12826,12824,12822,12819,12817,12815,12812,12810,12808,12805,12803,12801,12798,12796,12794,12791,12789,12787,12784,12782,12780,12778,12775,12773,12771,12768,12766,12764,12761,12759,12757,12754,12752,12750,12747,12745,12743,12740,12738,12736,12733,12731,12729,12726,12724,12721,12719,12717,12714,12712,12710,12707,12705,12703,12700,12698,12696,12693,12691,12689,12686,12684,12682,12679,12677,12675,12672,12670,12668,12665,12663,12661,12658,12656,12654,12651,12649,12646,12644,12642,12639,12637,12635,12632,12630,12628,12625,12623,12621,12618,12616,12614,12611,12609,12607,12604,12602,12599,12597,12595,12592,12590,12588,12585,12583,12581,12578,12576,12574,12571,12569,12566,12564,12562,12559,12557,12555,12552,12550,12548,12545,12543,12540,12538,12536,12533,12531,12529,12526,12524,12522,12519,12517,12514,12512,12510,12507,12505,12503,12500,12498,12495,12493,12491,12488,12486,12484,12481,12479,12476,12474,12472,12469,12467,12465,12462,12460,12457,12455,12453,12450,12448,12446,12443,12441,12438,12436,12434,12431,12429,12427,12424,12422,12419,12417,12415,12412,12410,12407,12405,12403,12400,12398,12396,12393,12391,12388,12386,12384,12381,12379,12376,12374,12372,12369,12367,12364,12362,12360,12357,12355,12352,12350,12348,12345,12343,12341,12338,12336,12333,12331,12329,12326,12324,12321,12319,12317,12314,12312,12309,12307,12305,12302,12300,12297,12295,12293,12290,12288,12285,12283,12281,12278,12276,12273,12271,12268,12266,12264,12261,12259,12256,12254,12252,12249,12247,12244,12242,12240,12237,12235,12232,12230,12228,12225,12223,12220,12218,12215,12213,12211,12208,12206,12203,12201,12199,12196,12194,12191,12189,12186,12184,12182,12179,12177,12174,12172,12169,12167,12165,12162,12160,12157,12155,12153,12150,12148,12145,12143,12140,12138,12136,12133,12131,12128,12126,12123,12121,12119,12116,12114,12111,12109,12106,12104,12102,12099,12097,12094,12092,12089,12087,12084,12082,12080,12077,12075,12072,12070,12067,12065,12063,12060,12058,12055,12053,12050,12048,12045,12043,12041,12038,12036,12033,12031,12028,12026,12023,12021,12019,12016,12014,12011,12009,12006,12004,12001,11999,11996,11994,11992,11989,11987,11984,11982,11979,11977,11974,11972,11970,11967,11965,11962,11960,11957,11955,11952,11950,11947,11945,11942,11940,11938,11935,11933,11930,11928,11925,11923,11920,11918,11915,11913,11910,11908,11906,11903,11901,11898,11896,11893,11891,11888,11886,11883,11881,11878,11876,11873,11871,11869,11866,11864,11861,11859,11856,11854,11851,11849,11846,11844,11841,11839,11836,11834,11831,11829,11826,11824,11821,11819,11816,11814,11812,11809,11807,11804,11802,11799,11797,11794,11792,11789,11787,11784,11782,11779,11777,11774,11772,11769,11767,11764,11762,11759,11757,11754,11752,11749,11747,11744,11742,11739,11737,11734,11732,11729,11727,11724,11722,11719,11717,11714,11712,11709,11707,11704,11702,11699,11697,11694,11692,11689,11687,11684,11682,11679,11677,11674,11672,11669,11667,11664,11662,11659,11657,11654,11652,11649,11647,11644,11642,11639,11637,11634,11632,11629,11627,11624,11622,11619,11617,11614,11612,11609,11607,11604,11601,11599,11596,11594,11591,11589,11586,11584,11581,11579,11576,11574,11571,11569,11566,11564,11561,11559,11556,11554,11551,11548,11546,11543,11541,11538,11536,11533,11531,11528,11526,11523,11521,11518,11516,11513,11511,11508,11505,11503,11500,11498,11495,11493,11490,11488,11485,11483,11480,11478,11475,11472,11470,11467,11465,11462,11460,11457,11455,11452,11450,11447,11444,11442,11439,11437,11434,11432,11429,11427,11424,11421,11419,11416,11414,11411,11409,11406,11404,11401,11398,11396,11393,11391,11388,11386,11383,11381,11378,11375,11373,11370,11368,11365,11363,11360,11358,11355,11352,11350,11347,11345,11342,11340,11337,11334,11332,11329,11327,11324,11322,11319,11316,11314,11311,11309,11306,11304,11301,11298,11296,11293,11291,11288,11286,11283,11280,11278,11275,11273,11270,11267,11265,11262,11260,11257,11255,11252,11249,11247,11244,11242,11239,11236,11234,11231,11229,11226,11224,11221,11218,11216,11213,11211,11208,11205,11203,11200,11198,11195,11192,11190,11187,11185,11182,11179,11177,11174,11172,11169,11166,11164,11161,11159,11156,11153,11151,11148,11146,11143,11140,11138,11135,11133,11130,11127,11125,11122,11120,11117,11114,11112,11109,11106,11104,11101,11099,11096,11093,11091,11088,11086,11083,11080,11078,11075,11072,11070,11067,11065,11062,11059,11057,11054,11052,11049,11046,11044,11041,11038,11036,11033,11031,11028,11025,11023,11020,11017,11015,11012,11009,11007,11004,11002,10999,10996,10994,10991,10988,10986,10983,10980,10978,10975,10973,10970,10967,10965,10962,10959,10957,10954,10951,10949,10946,10944,10941,10938,10936,10933,10930,10928,10925,10922,10920,10917,10914,10912,10909,10906,10904,10901,10898,10896,10893,10890,10888,10885,10883,10880,10877,10875,10872,10869,10867,10864,10861,10859,10856,10853,10851,10848,10845,10843,10840,10837,10835,10832,10829,10827,10824,10821,10819,10816,10813,10811,10808,10805,10803,10800,10797,10795,10792,10789,10786,10784,10781,10778,10776,10773,10770,10768,10765,10762,10760,10757,10754,10752,10749,10746,10744,10741,10738,10735,10733,10730,10727,10725,10722,10719,10717,10714,10711,10709,10706,10703,10700,10698,10695,10692,10690,10687,10684,10682,10679,10676,10674,10671,10668,10665,10663,10660,10657,10655,10652,10649,10646,10644,10641,10638,10636,10633,10630,10627,10625,10622,10619,10617,10614,10611,10608,10606,10603,10600,10598,10595,10592,10589,10587,10584,10581,10579,10576,10573,10570,10568,10565,10562,10559,10557,10554,10551,10549,10546,10543,10540,10538,10535,10532,10529,10527,10524,10521,10519,10516,10513,10510,10508,10505,10502,10499,10497,10494,10491,10488,10486,10483,10480,10477,10475,10472,10469,10466,10464,10461,10458,10455,10453,10450,10447,10444,10442,10439,10436,10433,10431,10428,10425,10422,10420,10417,10414,10411,10409,10406,10403,10400,10398,10395,10392,10389,10386,10384,10381,10378,10375,10373,10370,10367,10364,10362,10359,10356,10353,10350,10348,10345,10342,10339,10337,10334,10331,10328,10325,10323,10320,10317,10314,10312,10309,10306,10303,10300,10298,10295,10292,10289,10286,10284,10281,10278,10275,10273,10270,10267,10264,10261,10259,10256,10253,10250,10247,10245,10242,10239,10236,10233,10231,10228,10225,10222,10219,10217,10214,10211,10208,10205,10203,10200,10197,10194,10191,10188,10186,10183,10180,10177,10174,10172,10169,10166,10163,10160,10157,10155,10152,10149,10146,10143,10141,10138,10135,10132,10129,10126,10124,10121,10118,10115,10112,10109,10107,10104,10101,10098,10095,10092,10090,10087,10084,10081,10078,10075,10073,10070,10067,10064,10061,10058,10056,10053,10050,10047,10044,10041,10038,10036,10033,10030,10027,10024,10021,10018,10016,10013,10010,10007,10004,10001,9998,9996,9993,9990,9987,9984,9981,9978,9976,9973,9970,9967,9964,9961,9958,9956,9953,9950,9947,9944,9941,9938,9935,9933,9930,9927,9924,9921,9918,9915,9912,9909,9907,9904,9901,9898,9895,9892,9889,9886,9884,9881,9878,9875,9872,9869,9866,9863,9860,9858,9855,9852,9849,9846,9843,9840,9837,9834,9831,9829,9826,9823,9820,9817,9814,9811,9808,9805,9802,9799,9797,9794,9791,9788,9785,9782,9779,9776,9773,9770,9767,9765,9762,9759,9756,9753,9750,9747,9744,9741,9738,9735,9732,9729,9726,9724,9721,9718,9715,9712,9709,9706,9703,9700,9697,9694,9691,9688,9685,9682,9680,9677,9674,9671,9668,9665,9662,9659,9656,9653,9650,9647,9644,9641,9638,9635,9632,9629,9626,9624,9621,9618,9615,9612,9609,9606,9603,9600,9597,9594,9591,9588,9585,9582,9579,9576,9573,9570,9567,9564,9561,9558,9555,9552,9549,9546,9543,9540,9537,9534,9531,9528,9525,9523,9520,9517,9514,9511,9508,9505,9502,9499,9496,9493,9490,9487,9484,9481,9478,9475,9472,9469,9466,9463,9460,9457,9454,9451,9448,9445,9442,9439,9436,9433,9430,9427,9424,9421,9418,9415,9412,9409,9405,9402,9399,9396,9393,9390,9387,9384,9381,9378,9375,9372,9369,9366,9363,9360,9357,9354,9351,9348,9345,9342,9339,9336,9333,9330,9327,9324,9321,9318,9315,9312,9309,9305,9302,9299,9296,9293,9290,9287,9284,9281,9278,9275,9272,9269,9266,9263,9260,9257,9254,9250,9247,9244,9241,9238,9235,9232,9229,9226,9223,9220,9217,9214,9211,9208,9204,9201,9198,9195,9192,9189,9186,9183,9180,9177,9174,9171,9167,9164,9161,9158,9155,9152,9149,9146,9143,9140,9137,9133,9130,9127,9124,9121,9118,9115,9112,9109,9106,9102,9099,9096,9093,9090,9087,9084,9081,9078,9074,9071,9068,9065,9062,9059,9056,9053,9050,9046,9043,9040,9037,9034,9031,9028,9024,9021,9018,9015,9012,9009,9006,9003,8999,8996,8993,8990,8987,8984,8981,8977,8974,8971,8968,8965,8962,8959,8955,8952,8949,8946,8943,8940,8936,8933,8930,8927,8924,8921,8917,8914,8911,8908,8905,8902,8898,8895,8892,8889,8886,8883,8879,8876,8873,8870,8867,8864,8860,8857,8854,8851,8848,8844,8841,8838,8835,8832,8828,8825,8822,8819,8816,8813,8809,8806,8803,8800,8797,8793,8790,8787,8784,8780,8777,8774,8771,8768,8764,8761,8758,8755,8752,8748,8745,8742,8739,8735,8732,8729,8726,8723,8719,8716,8713,8710,8706,8703,8700,8697,8693,8690,8687,8684,8681,8677,8674,8671,8668,8664,8661,8658,8655,8651,8648,8645,8642,8638,8635,8632,8628,8625,8622,8619,8615,8612,8609,8606,8602,8599,8596,8593,8589,8586,8583,8579,8576,8573,8570,8566,8563,8560,8557,8553,8550,8547,8543,8540,8537,8533,8530,8527,8524,8520,8517,8514,8510,8507,8504,8501,8497,8494,8491,8487,8484,8481,8477,8474,8471,8467,8464,8461,8457,8454,8451,8447,8444,8441,8438,8434,8431,8428,8424,8421,8418,8414,8411,8408,8404,8401,8398,8394,8391,8387,8384,8381,8377,8374,8371,8367,8364,8361,8357,8354,8351,8347,8344,8341,8337,8334,8330,8327,8324,8320,8317,8314,8310,8307,8303,8300,8297,8293,8290,8287,8283,8280,8276,8273,8270,8266,8263,8259,8256,8253,8249,8246,8243,8239,8236,8232,8229,8226,8222,8219,8215,8212,8208,8205,8202,8198,8195,8191,8188,8185,8181,8178,8174,8171,8167,8164,8161,8157,8154,8150,8147,8143,8140,8137,8133,8130,8126,8123,8119,8116,8112,8109,8106,8102,8099,8095,8092,8088,8085,8081,8078,8074,8071,8068,8064,8061,8057,8054,8050,8047,8043,8040,8036,8033,8029,8026,8022,8019,8015,8012,8008,8005,8001,7998,7994,7991,7987,7984,7980,7977,7973,7970,7966,7963,7959,7956,7952,7949,7945,7942,7938,7935,7931,7928,7924,7921,7917,7914,7910,7907,7903,7900,7896,7892,7889,7885,7882,7878,7875,7871,7868,7864,7861,7857,7853,7850,7846,7843,7839,7836,7832,7829,7825,7821,7818,7814,7811,7807,7804,7800,7796,7793,7789,7786,7782,7779,7775,7771,7768,7764,7761,7757,7753,7750,7746,7743,7739,7735,7732,7728,7725,7721,7717,7714,7710,7707,7703,7699,7696,7692,7688,7685,7681,7678,7674,7670,7667,7663,7659,7656,7652,7649,7645,7641,7638,7634,7630,7627,7623,7619,7616,7612,7608,7605,7601,7597,7594,7590,7586,7583,7579,7575,7572,7568,7564,7561,7557,7553,7550,7546,7542,7539,7535,7531,7528,7524,7520,7516,7513,7509,7505,7502,7498,7494,7490,7487,7483,7479,7476,7472,7468,7464,7461,7457,7453,7450,7446,7442,7438,7435,7431,7427,7423,7420,7416,7412,7408,7405,7401,7397,7393,7390,7386,7382,7378,7375,7371,7367,7363,7359,7356,7352,7348,7344,7341,7337,7333,7329,7325,7322,7318,7314,7310,7306,7303,7299,7295,7291,7287,7284,7280,7276,7272,7268,7265,7261,7257,7253,7249,7245,7242,7238,7234,7230,7226,7222,7219,7215,7211,7207,7203,7199,7196,7192,7188,7184,7180,7176,7172,7169,7165,7161,7157,7153,7149,7145,7141,7138,7134,7130,7126,7122,7118,7114,7110,7106,7103,7099,7095,7091,7087,7083,7079,7075,7071,7067,7063,7059,7056,7052,7048,7044,7040,7036,7032,7028,7024,7020,7016,7012,7008,7004,7000,6996,6992,6989,6985,6981,6977,6973,6969,6965,6961,6957,6953,6949,6945,6941,6937,6933,6929,6925,6921,6917,6913,6909,6905,6901,6897,6893,6889,6885,6881,6877,6873,6869,6865,6861,6857,6853,6849,6845,6841,6837,6832,6828,6824,6820,6816,6812,6808,6804,6800,6796,6792,6788,6784,6780,6776,6772,6767,6763,6759,6755,6751,6747,6743,6739,6735,6731,6727,6722,6718,6714,6710,6706,6702,6698,6694,6689,6685,6681,6677,6673,6669,6665,6661,6656,6652,6648,6644,6640,6636,6631,6627,6623,6619,6615,6611,6606,6602,6598,6594,6590,6586,6581,6577,6573,6569,6565,6560,6556,6552,6548,6544,6539,6535,6531,6527,6522,6518,6514,6510,6506,6501,6497,6493,6489,6484,6480,6476,6472,6467,6463,6459,6454,6450,6446,6442,6437,6433,6429,6425,6420,6416,6412,6407,6403,6399,6394,6390,6386,6382,6377,6373,6369,6364,6360,6356,6351,6347,6343,6338,6334,6330,6325,6321,6316,6312,6308,6303,6299,6295,6290,6286,6282,6277,6273,6268,6264,6260,6255,6251,6246,6242,6238,6233,6229,6224,6220,6216,6211,6207,6202,6198,6193,6189,6184,6180,6176,6171,6167,6162,6158,6153,6149,6144,6140,6135,6131,6126,6122,6117,6113,6108,6104,6099,6095,6090,6086,6081,6077,6072,6068,6063,6059,6054,6050,6045,6041,6036,6032,6027,6022,6018,6013,6009,6004,6000,5995,5990,5986,5981,5977,5972,5967,5963,5958,5954,5949,5944,5940,5935,5931,5926,5921,5917,5912,5907,5903,5898,5893,5889,5884,5879,5875,5870,5865,5861,5856,5851,5847,5842,5837,5833,5828,5823,5819,5814,5809,5804,5800,5795,5790,5785,5781,5776,5771,5766,5762,5757,5752,5747,5743,5738,5733,5728,5724,5719,5714,5709,5704,5700,5695,5690,5685,5680,5675,5671,5666,5661,5656,5651,5646,5642,5637,5632,5627,5622,5617,5612,5608,5603,5598,5593,5588,5583,5578,5573,5568,5563,5558,5554,5549,5544,5539,5534,5529,5524,5519,5514,5509,5504,5499,5494,5489,5484,5479,5474,5469,5464,5459,5454,5449,5444,5439,5434,5429,5424,5419,5414,5409,5404,5399,5394,5389,5384,5378,5373,5368,5363,5358,5353,5348,5343,5338,5333,5327,5322,5317,5312,5307,5302,5297,5291,5286,5281,5276,5271,5266,5260,5255,5250,5245,5240,5234,5229,5224,5219,5213,5208,5203,5198,5192,5187,5182,5177,5171,5166,5161,5155,5150,5145,5140,5134,5129,5124,5118,5113,5108,5102,5097,5092,5086,5081,5075,5070,5065,5059,5054,5049,5043,5038,5032,5027,5021,5016,5011,5005,5000,4994,4989,4983,4978,4972,4967,4961,4956,4950,4945,4939,4934,4928,4923,4917,4912,4906,4901,4895,4889,4884,4878,4873,4867,4861,4856,4850,4845,4839,4833,4828,4822,4816,4811,4805,4799,4794,4788,4782,4777,4771,4765,4760,4754,4748,4742,4737,4731,4725,4719,4714,4708,4702,4696,4690,4685,4679,4673,4667,4661,4656,4650,4644,4638,4632,4626,4620,4614,4609,4603,4597,4591,4585,4579,4573,4567,4561,4555,4549,4543,4537,4531,4525,4519,4513,4507,4501,4495,4489,4483,4477,4471,4465,4459,4453,4446,4440,4434,4428,4422,4416,4410,4403,4397,4391,4385,4379,4372,4366,4360,4354,4348,4341,4335,4329,4322,4316,4310,4304,4297,4291,4285,4278,4272,4266,4259,4253,4246,4240,4234,4227,4221,4214,4208,4201,4195,4189,4182,4176,4169,4163,4156,4149,4143,4136,4130,4123,4117,4110,4103,4097,4090,4084,4077,4070,4064,4057,4050,4044,4037,4030,4023,4017,4010,4003,3996,3990,3983,3976,3969,3962,3955,3949,3942,3935,3928,3921,3914,3907,3900,3893,3886,3879,3872,3865,3858,3851,3844,3837,3830,3823,3816,3809,3802,3795,3787,3780,3773,3766,3759,3751,3744,3737,3730,3723,3715,3708,3701,3693,3686,3679,3671,3664,3656,3649,3642,3634,3627,3619,3612,3604,3597,3589,3582,3574,3567,3559,3551,3544,3536,3528,3521,3513,3505,3498,3490,3482,3474,3467,3459,3451,3443,3435,3427,3419,3412,3404,3396,3388,3380,3372,3364,3356,3348,3339,3331,3323,3315,3307,3299,3291,3282,3274,3266,3257,3249,3241,3233,3224,3216,3207,3199,3190,3182,3173,3165,3156,3148,3139,3131,3122,3113,3105,3096,3087,3078,3070,3061,3052,3043,3034,3025,3016,3007,2998,2989,2980,2971,2962,2953,2944,2935,2926,2916,2907,2898,2888,2879,2870,2860,2851,2841,2832,2822,2813,2803,2793,2784,2774,2764,2755,2745,2735,2725,2715,2705,2695,2685,2675,2665,2655,2645,2634,2624,2614,2604,2593,2583,2572,2562,2551,2541,2530,2519,2509,2498,2487,2476,2465,2454,2443,2432,2421,2410,2399,2388,2376,2365,2354,2342,2331,2319,2307,2296,2284,2272,2260,2248,2236,2224,2212,2200,2188,2175,2163,2150,2138,2125,2112,2100,2087,2074,2061,2048,2035,2021,2008,1994,1981,1967,1954,1940,1926,1912,1898,1883,1869,1855,1840,1825,1811,1796,1781,1765,1750,1735,1719,1703,1688,1672,1655,1639,1623,1606,1589,1572,1555,1538,1520,1502,1484,1466,1447,1429,1410,1391,1371,1351,1331,1311,1290,1269,1248,1226,1204,1182,1159,1135,1111,1087,1062,1036,1010,983,955,927,898,867,836,803,769,733,695,655,613,568,518,463,401,328,232,0,0,0,0,0,0,0,0,0,0 };//Pi*16384   PI/2 25736缂冾噣娴?
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																												 /*const */
//int ptr_w_16[2 * 16] =
//{
//	0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x30FBC540
//	,0x7641AF80
//	,0x5A827980
//	,0x5A827A00
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0x5A827A00
//	,0x7FFFFFFF
//	,0x000000A2
//	,0x5A827980
//	,0xA57D8680
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0xA57D8680
//	,0xCF043AC0
//	,0x89BE5100
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//};
///*const*/ int ptr_w_32[2 * 32] =
//{
//	0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x18F8B820
//	,0x7D8A5F80
//	,0x30FBC540
//	,0x7641AF80
//	,0x471CED00
//	,0x6A6D9880
//	,0x30FBC540
//	,0x7641AF80
//	,0x5A827980
//	,0x5A827A00
//	,0x7641AF00
//	,0x30FBC540
//	,0x471CED00
//	,0x6A6D9880
//	,0x7641AF00
//	,0x30FBC540
//	,0x7D8A5F00
//	,0xE70747C0
//	,0x5A827980
//	,0x5A827A00
//	,0x7FFFFFFF
//	,0x000000A2
//	,0x5A827980
//	,0xA57D8680
//	,0x6A6D9880
//	,0x471CED00
//	,0x7641AF80
//	,0xCF043B00
//	,0x18F8B820
//	,0x8275A080
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0xA57D8680
//	,0xCF043AC0
//	,0x89BE5100
//	,0x7D8A5F00
//	,0x18F8B880
//	,0x30FBC5C0
//	,0x89BE5100
//	,0x95926880
//	,0xB8E31180
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x5A827980
//	,0x5A827A00
//	,0x7FFFFFFF
//	,0x000000A2
//	,0x5A827980
//	,0xA57D8680
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//};
///*const*/ int ptr_w_64[2 * 64] =
//{
//	0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x0C8BD350
//	,0x7F623680
//	,0x18F8B820
//	,0x7D8A5F80
//	,0x25280C40
//	,0x7A7D0580
//	,0x18F8B820
//	,0x7D8A5F80
//	,0x30FBC540
//	,0x7641AF80
//	,0x471CED00
//	,0x6A6D9880
//	,0x25280C40
//	,0x7A7D0580
//	,0x471CED00
//	,0x6A6D9880
//	,0x62F20180
//	,0x5133CC80
//	,0x30FBC540
//	,0x7641AF80
//	,0x5A827980
//	,0x5A827A00
//	,0x7641AF00
//	,0x30FBC540
//	,0x3C56BA40
//	,0x70E2CC00
//	,0x6A6D9880
//	,0x471CED00
//	,0x7F623680
//	,0x0C8BD350
//	,0x471CED00
//	,0x6A6D9880
//	,0x7641AF00
//	,0x30FBC540
//	,0x7D8A5F00
//	,0xE70747C0
//	,0x5133CC80
//	,0x62F20200
//	,0x7D8A5F00
//	,0x18F8B880
//	,0x70E2CC00
//	,0xC3A94680
//	,0x5A827980
//	,0x5A827A00
//	,0x7FFFFFFF
//	,0x000000A2
//	,0x5A827980
//	,0xA57D8680
//	,0x62F20180
//	,0x5133CC80
//	,0x7D8A5F00
//	,0xE70747C0
//	,0x3C56BB40
//	,0x8F1D3480
//	,0x6A6D9880
//	,0x471CED00
//	,0x7641AF80
//	,0xCF043B00
//	,0x18F8B820
//	,0x8275A080
//	,0x70E2CB80
//	,0x3C56BAC0
//	,0x6A6D9900
//	,0xB8E31380
//	,0xF3742D90
//	,0x809DC980
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0xA57D8680
//	,0xCF043AC0
//	,0x89BE5100
//	,0x7A7D0500
//	,0x25280D00
//	,0x471CEE00
//	,0x95926800
//	,0xAECC3400
//	,0x9D0DFD80
//	,0x7D8A5F00
//	,0x18F8B880
//	,0x30FBC5C0
//	,0x89BE5100
//	,0x95926880
//	,0xB8E31180
//	,0x7F623680
//	,0x0C8BD350
//	,0x18F8B820
//	,0x8275A080
//	,0x8582FA80
//	,0xDAD7F4C0
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x00000000
//	,0x7FFFFFFF
//	,0x30FBC540
//	,0x7641AF80
//	,0x5A827980
//	,0x5A827A00
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0x5A827A00
//	,0x7FFFFFFF
//	,0x000000A2
//	,0x5A827980
//	,0xA57D8680
//	,0x7641AF00
//	,0x30FBC540
//	,0x5A827980
//	,0xA57D8680
//	,0xCF043AC0
//	,0x89BE5100
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//	,0x00000000
//};
int ptr_w_16[2 * 16] =
{
	0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,static_cast<int>(0x30FBC540)
	,static_cast<int>(0x7641AF80)
	,static_cast<int>(0x5A827980)
	,static_cast<int>(0x5A827A00)
	,static_cast<int>(0x7641AF00)
	,static_cast<int>(0x30FBC540)
	,static_cast<int>(0x5A827980)
	,static_cast<int>(0x5A827A00)
	,static_cast<int>(0x7FFFFFFF)
	,static_cast<int>(0x000000A2)
	,static_cast<int>(0x5A827980)
	,static_cast<int>(0xA57D8680)
	,static_cast<int>(0x7641AF00)
	,static_cast<int>(0x30FBC540)
	,static_cast<int>(0x5A827980)
	,static_cast<int>(0xA57D8680)
	,static_cast<int>(0xCF043AC0)
	,static_cast<int>(0x89BE5100)
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
};
/*const*/ int ptr_w_32[2 * 32] =
{
	0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x18F8B820
	,0x7D8A5F80
	,0x30FBC540
	,0x7641AF80
	,0x471CED00
	,0x6A6D9880
	,0x30FBC540
	,0x7641AF80
	,0x5A827980
	,0x5A827A00
	,0x7641AF00
	,0x30FBC540
	,0x471CED00
	,0x6A6D9880
	,0x7641AF00
	,0x30FBC540
	,0x7D8A5F00
	,static_cast<int>(0xE70747C0)
	,0x5A827980
	,0x5A827A00
	,static_cast<int>(0x7FFFFFFF)
	,0x000000A2
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,0x6A6D9880
	,0x471CED00
	,0x7641AF80
	,static_cast<int>(0xCF043B00)
	,0x18F8B820
	,static_cast<int>(0x8275A080)
	,0x7641AF00
	,0x30FBC540
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,static_cast<int>(0xCF043AC0)
	,static_cast<int>(0x89BE5100)
	,static_cast<int>(0x7D8A5F00)
	,0x18F8B880
	,0x30FBC5C0
	,static_cast<int>(0x89BE5100)
	,static_cast<int>(0x95926880)
	,static_cast<int>(0xB8E31180)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x00000000
	,static_cast<int>(0x7FFFFFFF)
	,0x5A827980
	,0x5A827A00
	,static_cast<int>(0x7FFFFFFF)
	,0x000000A2
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
};
/*const*/ int ptr_w_64[2 * 64] =
{
	0x00000000
	,0x7FFFFFFF
	,0x00000000
	,0x7FFFFFFF
	,0x00000000
	,0x7FFFFFFF
	,0x0C8BD350
	,0x7F623680
	,0x18F8B820
	,0x7D8A5F80
	,0x25280C40
	,0x7A7D0580
	,0x18F8B820
	,0x7D8A5F80
	,0x30FBC540
	,0x7641AF80
	,0x471CED00
	,0x6A6D9880
	,0x25280C40
	,0x7A7D0580
	,0x471CED00
	,0x6A6D9880
	,0x62F20180
	,0x5133CC80
	,0x30FBC540
	,0x7641AF80
	,0x5A827980
	,0x5A827A00
	,0x7641AF00
	,0x30FBC540
	,0x3C56BA40
	,0x70E2CC00
	,0x6A6D9880
	,0x471CED00
	,0x7F623680
	,0x0C8BD350
	,0x471CED00
	,0x6A6D9880
	,0x7641AF00
	,0x30FBC540
	,0x7D8A5F00
	,static_cast<int>(0xE70747C0)
	,0x5133CC80
	,0x62F20200
	,0x7D8A5F00
	,0x18F8B880
	,0x70E2CC00
	,static_cast<int>(0xC3A94680)
	,0x5A827980
	,0x5A827A00
	,0x7FFFFFFF
	,0x000000A2
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,0x62F20180
	,0x5133CC80
	,0x7D8A5F00
	,static_cast<int>(0xE70747C0)
	,0x3C56BB40
	,static_cast<int>(0x8F1D3480)
	,0x6A6D9880
	,0x471CED00
	,0x7641AF80
	,static_cast<int>(0xCF043B00)
	,0x18F8B820
	,static_cast<int>(0x8275A080)
	,0x70E2CB80
	,0x3C56BAC0
	,0x6A6D9900
	,static_cast<int>(0xB8E31380)
	,static_cast<int>(0xF3742D90)
	,static_cast<int>(0x809DC980)
	,0x7641AF00
	,0x30FBC540
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,static_cast<int>(0xCF043AC0)
	,static_cast<int>(0x89BE5100)
	,0x7A7D0500
	,0x25280D00
	,0x471CEE00
	,static_cast<int>(0x95926800)
	,static_cast<int>(0xAECC3400)
	,static_cast<int>(0x9D0DFD80)
	,0x7D8A5F00
	,0x18F8B880
	,0x30FBC5C0
	,static_cast<int>(0x89BE5100)
	,static_cast<int>(0x95926880)
	,static_cast<int>(0xB8E31180)
	,0x7F623680
	,0x0C8BD350
	,0x18F8B820
	,static_cast<int>(0x8275A080)
	,static_cast<int>(0x8582FA80)
	,static_cast<int>(0xDAD7F4C0)
	,0x00000000
	,0x7FFFFFFF
	,0x00000000
	,0x7FFFFFFF
	,0x00000000
	,0x7FFFFFFF
	,0x30FBC540
	,0x7641AF80
	,0x5A827980
	,0x5A827A00
	,0x7641AF00
	,0x30FBC540
	,0x5A827980
	,0x5A827A00
	,0x7FFFFFFF
	,0x000000A2
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,0x7641AF00
	,0x30FBC540
	,0x5A827980
	,static_cast<int>(0xA57D8680)
	,static_cast<int>(0xCF043AC0)
	,static_cast<int>(0x89BE5100)
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
	,0x00000000
};
volatile int input_target_pos[2] = { 2 * SIZE * 10 / 2 ,2 * SIZE * 10 / 2 };
float init_patch_sz[2] = { 2 * SIZE * 10,2 * SIZE * 10 };
float init_pos[2] = { 112 + SIZE / 2,150 + SIZE / 2 };//target's ypos,xpos of leftup
volatile float target_sz[2] = { SIZE,SIZE };//yhight,xlength
float sum = 0;
int sumreal = 0, sumimag = 0;
float freal = 0, fimag = 0;
//key factor 
float padding = 1.0;  //search area  系数*（1 + padding）
float output_sigma_factor = 0.0625;  // bandwidth of gaussian target
float lambda = 0.01;  // 0.01  // regularization
float interp_factor = 0.025; //0.025   // linear interpolation factor for adaptation
float nScales = 17;  // of scaling windows
float nScalesInterp = 33;  //尺度数量  // of interpolation scales
float scale_step = 1.02; //1.02 尺度因子  // scale step for multi-scale estimation
float scale_sigma_factor = 0.0625;   // bandwidth of gaussian target
float scale_model_factor = 0.7071;//0.7071;
float scale_model_max_area = 256;//256;
float learning_rate = 0.025;  //0.025
float num_compressed_dim = 18;

float featureRatio = 4;
int number_of_scales = 33;
float s_num_compressed_dim = 17;  //特征维数
int nOrients = 9;
volatile float pos[2];//={floor(floor(init_pos[0])+floor(targetz_sz[0]/2)),floor(floor(init_pos[1])+floor(targetz_sz[1]/2))};
float init_target_sz[2];//={target_sz[0],target_sz[1]};
float base_target_sz[2];//={target_sz[0],target_sz[1]};
volatile int sz[2];//={floor((padding+1)*base_target_sz[0]),floor((padding+1)*base_target_sz[1])};
float output_sigma;//=output_sigma_factor*sqrt(base_target_sz[0]*base_target_sz[1]);
float scale_sigma;//(sqrt(33))*scale_sigma_factor;
float scaleSizeFactors[17];  //17个尺度变化因子
float interpScaleFactors[33]; //33个内插尺度变化因子

int interp_sz[2]; //插值尺寸
float use_sz[2];
int scale_window[33];  //33个尺度变化因子
float scale_model_sz[2];
float max_scale_dim = 1;
float currentScaleFactor = 2; //1
float min_scale_factor = 1;
float max_scale_factor = 8;
volatile int row, col;
volatile int row_con, col_con;
volatile int maxresponse = 0;
volatile int maxscaleresponse = 0;
int framelosingcnt;
volatile int frame = 0;

unsigned char windowdata[2 * SIZE * 2 * SIZE * 10 * 10];//尺度最大为10倍开窗，与最大尺度有关当前为10倍窗口

unsigned char im_patch[1024 * 768];// [2 * SIZE * 2 * SIZE * 10 * 10] ;//   图像尺寸
unsigned char tempimg[2 * SIZE * 2 * SIZE];//temp
int xl[(2 * SIZE * 2 * SIZE) / 16]; //
int h_num_xl[(2 * SIZE * 2 * SIZE) / 16];
int h_num_xlf[2 * (2 * SIZE * 2 * SIZE) / 16];
int xlf[2 * (2 * SIZE * 2 * SIZE) / 16];
int new_hf_den[(2 * SIZE * 2 * SIZE) / 16];
int hf_den[(2 * SIZE * 2 * SIZE) / 16];
int new_hf_num[2 * (2 * SIZE * 2 * SIZE) / 16];
int hf_num[2 * (2 * SIZE * 2 * SIZE) / 16];


int xs[144 * 32];
int xs_num[144 * 32];
int scale_basis[144 * 32];
int scale_basis_den[144 * 32];
int xsf[2 * 32 * 144];
int sf[2 * 32 * 144];
//int *xs;//[256*17];
//int *xsf;//[2*17*256];
int sf_num[2 * 32 * 144];
int new_sf_num[144 * 32 * 2];
int sf_den[32];
int new_sf_den[32];
int framelimit = 0;
int imgscaletemp[SIZE * SIZE / 4] =/*
								   { 192,195,200,205,212,221,227,232,235,238,240,237,228,220,214,204,
								   185,187,192,197,202,212,221,229,233,235,238,234,225,221,221,211,
								   176,178,183,188,193,201,211,222,229,233,234,228,219,218,222,217,
								   168,172,176,182,188,196,202,212,221,228,229,225,216,216,221,219,
								   145,165,172,177,185,194,202,208,217,223,224,223,219,219,221,221,
								   120,150,164,177,185,193,199,208,217,227,229,227,225,225,225,226,
								   124,155,167,178,184,190,196,210,222,233,235,232,229,228,230,232,
								   160,188,188,180,180,184,192,210,222,236,238,233,230,230,232,235,
								   202,213,201,181,178,182,187,204,216,233,237,234,231,231,233,234,
								   232,224,205,180,170,173,178,190,204,224,234,234,233,232,233,234,
								   239,225,205,179,162,164,170,180,193,214,230,235,234,234,234,235,
								   241,225,205,178,162,161,163,170,179,201,224,234,235,235,236,236,
								   237,224,202,175,158,152,153,161,170,190,215,230,236,237,237,237,
								   226,214,190,164,143,130,133,148,158,179,202,223,234,237,237,236,
								   201,189,166,141,123,111,114,130,139,166,190,212,230,235,236,236,
								   177,168,149,129,116,106,108,121,129,154,178,203,224,233,234,234 };*/
{ 132,184,204,200,202,200,201,201,198,189,129,89,101,88,94,107,
115,182,198,197,198,199,200,196,191,140,98,89,86,73,79,110,
101,153,186,191,197,195,195,189,188,102,54,85,74,69,69,81,
94,122,172,185,191,192,193,190,179,93,51,73,57,62,71,70,
84,88,155,179,183,188,189,185,175,122,70,71,61,61,63,62,
63,71,107,177,180,186,184,175,169,107,68,61,53,52,55,57,
64,69,85,171,187,191,186,179,150,63,53,48,33,33,45,51,
61,66,151,185,186,188,181,177,118,58,52,47,28,23,32,54,
58,72,160,190,185,183,171,162,108,78,46,32,22,26,20,41,
65,138,184,200,195,192,179,176,158,140,85,42,35,22,18,23,
141,193,204,204,199,197,191,192,193,178,162,123,65,17,27,22,
204,200,208,205,201,196,194,192,193,193,188,175,120,39,17,24,
201,202,205,195,197,192,191,192,192,194,190,183,159,97,32,19,
202,204,197,170,165,147,147,180,189,190,189,181,167,133,62,20,
204,198,145,63,71,54,54,136,186,180,178,174,170,146,66,29,
192,180,87,15,34,34,31,120,176,172,169,160,164,146,57,27 };
//目标搜索区
//volatile int nbpos[9][2]={{0,0},{0,40},{20,20},{40,0},{20,-20},{0,-40},{-20,-20},{-40,0},{-20,20}};  //米字型
//volatile int nbpos[9][2] = { {0,0},{0,36},{25,25},{36,0},{25,-25},{0,-36},{-25,-25},{-36,0},{-25,25} };  //米字型

volatile int nbpos[5][2] = { { 0,0 },{ 0,36 },{ 0,-36 },{ 36,0 },{ -36,0 } }; //增加搜索区  -- 上下左右 -- 较好
																			  //volatile int nbpos[5][2] = {{0,-48},{-24,-24},{-48,0},{-24,24}}; //  

volatile float pos_temp[2];
volatile int maxconfidences = 0;
volatile int lastmaxconfidences = 0;
volatile int lasting_lostframes = 0;
volatile int confidences = 0;
volatile int recovered_scale = 0;
int M[SIZE*SIZE / 4];
int O[SIZE*SIZE / 4];
int newimgflag = 0;

int fastIntSqrt(int n)
{
	int tmp, nHat = 0, b = 0x8000, bshift = 15;
	do
	{
		if (n >= (tmp = (((nHat << 1) + b) << bshift--)))
		{
			nHat += b;
			n -= tmp;
		}
	} while (b >>= 1);
	return nHat;
}

void DSP_fft32x32(int * ptr_w, int npoints, int * ptr_x, int * ptr_y)
{
	int   i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp;
	int   xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
	int   xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
	int   xh0_1, xh1_1, xl0_1, xl1_1;
	int   x_0, x_1, x_2, x_3, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
	int   xh0_2, xh1_2, xl0_2, xl1_2, xh0_3, xh1_3, xl0_3, xl1_3;
	int   x_4, x_5, x_6, x_7, x_h2_0, x_h2_1;
	int   x_8, x_9, x_a, x_b, x_c, x_d, x_e, x_f;
	int   si10, si20, si30, co10, co20, co30;
	int   *w;
	int   *x, *x2, *x0;
	int   *y0, *y1, *y2, *y3;
	int   n00, n10, n20, n30, n01, n11, n21, n31;
	int   n02, n12, n22, n32, n03, n13, n23, n33;
	int   n0, j0;
	int   radix;
	int   norm;
	int   m;

	/*---------------------------------------------------------------------*/
	/* Determine the magnitude od the number of points to be transformed.  */
	/* Check whether we can use a radix4 decomposition or a mixed radix    */
	/* transformation, by determining modulo 2.                            */
	/*---------------------------------------------------------------------*/

	for (i = 31, m = 1; (npoints & (1 << i)) == 0; i--, m++);
	radix = m & 1 ? 2 : 4;
	norm = m - 2;

	/*----------------------------------------------------------------------*/
	/* The stride is quartered with every iteration of the outer loop. It   */
	/* denotes the seperation between any two adjacent inputs to the butter */
	/* -fly. This should start out at N/4, hence stride is initially set to */
	/* N. For every stride, 6*stride twiddle factors are accessed. The      */
	/* "tw_offset" is the offset within the current twiddle factor sub-     */
	/* table. This is set to zero, at the start of the code and is used to  */
	/* obtain the appropriate sub-table twiddle pointer by offseting it     */
	/* with the base pointer "ptr_w".                                       */
	/*----------------------------------------------------------------------*/

	stride = npoints;
	tw_offset = 0;
	fft_jmp = 6 * stride;

	//#ifndef NOASSUME
	//	_nassert(stride > 4);
	//#pragma MUST_ITERATE(1,,1);
	//#endif

	while (stride > radix)
	{
		/*-----------------------------------------------------------------*/
		/* At the start of every iteration of the outer loop, "j" is set   */
		/* to zero, as "w" is pointing to the correct location within the  */
		/* twiddle factor array. For every iteration of the inner loop     */
		/* 6 * stride twiddle factors are accessed. For eg,                */
		/*                                                                 */
		/* #Iteration of outer loop  # twiddle factors    #times cycled    */
		/*  1                          6 N/4               1               */
		/*  2                          6 N/16              4               */
		/*  ...                                                            */
		/*-----------------------------------------------------------------*/

		j = 0;
		fft_jmp >>= 2;

		/*-----------------------------------------------------------------*/
		/* Set up offsets to access "N/4", "N/2", "3N/4" complex point or  */
		/* "N/2", "N", "3N/2" half word                                    */
		/*-----------------------------------------------------------------*/

		h2 = stride >> 1;
		l1 = stride;
		l2 = stride + (stride >> 1);

		/*-----------------------------------------------------------------*/
		/*  Reset "x" to point to the start of the input data array.       */
		/* "tw_offset" starts off at 0, and increments by "6 * stride"     */
		/*  The stride quarters with every iteration of the outer loop     */
		/*-----------------------------------------------------------------*/

		x = ptr_x;
		w = ptr_w + tw_offset;
		tw_offset += fft_jmp;

		stride >>= 2;

		/*----------------------------------------------------------------*/
		/* The following loop iterates through the different butterflies, */
		/* within a given stage. Recall that there are logN to base 4     */
		/* stages. Certain butterflies share the twiddle factors. These   */
		/* are grouped together. On the very first stage there are no     */
		/* butterflies that share the twiddle factor, all N/4 butter-     */
		/* flies have different factors. On the next stage two sets of    */
		/* N/8 butterflies share the same twiddle factor. Hence after     */
		/* half the butterflies are performed, j the index into the       */
		/* factor array resets to 0, and the twiddle factors are reused.  */
		/* When this happens, the data pointer 'x' is incremented by the  */
		/* fft_jmp amount.                                                */
		/*----------------------------------------------------------------*/

		//#ifndef NOASSUME
		//		_nassert((int)(w) % 8 == 0);
		//		_nassert((int)(x) % 8 == 0);
		//		_nassert(h2 % 8 == 0);
		//		_nassert(l1 % 8 == 0);
		//		_nassert(l2 % 8 == 0);
		//		_nassert(npoints >= 16);
		//#pragma MUST_ITERATE(4, , 1);
		//#endif

		for (i = 0; i < npoints; i += 4)
		{
			/*------------------------------------------------------------*/
			/*  Read the first three twiddle factor values. This loop co- */
			/*  mputes one radix 4 butterfly at a time.                   */
			/*------------------------------------------------------------*/

			co10 = w[j + 1];            si10 = w[j + 0];
			co20 = w[j + 3];            si20 = w[j + 2];
			co30 = w[j + 5];            si30 = w[j + 4];

			/*-----------------------------------------------------------*/
			/* Read in the data elements for the four inputs of radix4   */
			/* butterfly.                                                */
			/*-----------------------------------------------------------*/

			x_0 = x[0];            x_1 = x[1];
			x_l1_0 = x[l1];         x_l1_1 = x[l1 + 1];
			x_l2_0 = x[l2];         x_l2_1 = x[l2 + 1];
			x_h2_0 = x[h2];         x_h2_1 = x[h2 + 1];

			/*-----------------------------------------------------------*/
			/* Perform radix2 style DIF butterflies, for initial radix4  */
			/*-----------------------------------------------------------*/

			xh0_0 = x_0 + x_l1_0;
			xh1_0 = x_1 + x_l1_1;
			xl0_0 = x_0 - x_l1_0;
			xl1_0 = x_1 - x_l1_1;
			xh20_0 = x_h2_0 + x_l2_0;
			xh21_0 = x_h2_1 + x_l2_1;
			xl20_0 = x_h2_0 - x_l2_0;
			xl21_0 = x_h2_1 - x_l2_1;

			/*-----------------------------------------------------------*/
			/* Derive output pointers using the input pointer "x"        */
			/*-----------------------------------------------------------*/

			x0 = x;
			x2 = x0;

			/*-----------------------------------------------------------*/
			/* When the twiddle factors are not to be re-used, j is      */
			/* incremented by 6, to reflect the fact that 6 half words   */
			/* are consumed in every iteration. The input data pointer   */
			/* increments by 2. Note that within a stage, the stride     */
			/* does not change and hence the offsets for the other three */
			/* legs, 0, h2, l1, l2.                                      */
			/*-----------------------------------------------------------*/

			j += 6;
			x += 2;
			predj = (j - fft_jmp);
			if (!predj) x += fft_jmp;
			if (!predj) j = 0;

			/*----------------------------------------------------------*/
			/* These four partial results can be re-written to show     */
			/* the underlying DIF structure similar to radix2 as        */
			/* follows:                                                 */
			/*                                                          */
			/* X(4k)  = (x(n)+x(n + N/2)) + (x(n+N/4)+ x(n + 3N/4))     */
			/* X(4k+1)= (x(n)-x(n + N/2)) -j(x(n+N/4) - x(n + 3N/4))    */
			/* x(4k+2)= (x(n)+x(n + N/2)) - (x(n+N/4)+ x(n + 3N/4))     */
			/* X(4k+3)= (x(n)-x(n + N/2)) +j(x(n+N/4) - x(n + 3N/4))    */
			/*                                                          */
			/* which leads to the real and imaginary values as foll:    */
			/*                                                          */
			/* y0r = x0r + x2r +  x1r +  x3r    =  xh0 + xh20           */
			/* y0i = x0i + x2i +  x1i +  x3i    =  xh1 + xh21           */
			/* y1r = x0r - x2r + (x1i -  x3i)   =  xl0 + xl21           */
			/* y1i = x0i - x2i - (x1r -  x3r)   =  xl1 - xl20           */
			/* y2r = x0r + x2r - (x1r +  x3r)   =  xh0 - xh20           */
			/* y2i = x0i + x2i - (x1i +  x3i    =  xh1 - xh21           */
			/* y3r = x0r - x2r - (x1i -  x3i)   =  xl0 - xl21           */
			/* y3i = x0i - x2i + (x1r -  x3r)   =  xl1 + xl20           */
			/* ---------------------------------------------------------*/

			x0[0] = xh0_0 + xh20_0;       x0[1] = xh1_0 + xh21_0;
			xt0_0 = xh0_0 - xh20_0;       yt0_0 = xh1_0 - xh21_0;
			xt1_0 = xl0_0 + xl21_0;       yt2_0 = xl1_0 + xl20_0;
			xt2_0 = xl0_0 - xl21_0;       yt1_0 = xl1_0 - xl20_0;

			/*-----------------------------------------------------------*/
			/* The following multiplies are close to a true 32 by 32     */
			/* multiply instruction.                                     */
			/* Perform twiddle factor multiplies of three terms,top      */
			/* term does not have any multiplies. Note the twiddle       */
			/* factors for a normal FFT are C + j (-S). Since the        */
			/* factors that are stored are C + j S, this is              */
			/* corrected for in the multiplies.                          */
			/*                                                           */
			/* Y1 = (xt1 + jyt1) (c + js) = (xc + ys) + (yc -xs)         */
			/* There is a loss of 1.5 bits of accuracy. This arises be-  */
			/* cause the result of the low sixteen by sixteen bits is    */
			/* not computed and the multiply of the low by high is       */
			/* shifted by 16, and results in a loss of 1 bit.            */
			/* Multiplies are performed for all the three legs of the    */
			/* radix4 butterfly are performed. In addition note that     */
			/* themiddle two legs are swapped. This is based on work     */
			/* done by Panos Papamichalis, on obtaining bit reversed     */
			/* order from a radix 4 butterfly. This allows the last      */
			/* stage to be performed either as a radix4 or a radix2      */
			/* pass for this stage.                                      */
			/*-----------------------------------------------------------*/

			x2[h2] = MPYHIRC(si10, yt1_0) + MPYHIRC(co10, xt1_0) +
				(((MPYLUHS(si10, yt1_0) + MPYLUHS(co10, xt1_0)
					+ 0x8000) >> 16) << 1);

			x2[h2 + 1] = MPYHIRC(co10, yt1_0) - MPYHIRC(si10, xt1_0) +
				(((MPYLUHS(co10, yt1_0) - MPYLUHS(si10, xt1_0)
					+ 0x8000) >> 16) << 1);

			x2[l1] = MPYHIRC(si20, yt0_0) + MPYHIRC(co20, xt0_0) +
				(((MPYLUHS(si20, yt0_0) + MPYLUHS(co20, xt0_0)
					+ 0x8000) >> 16) << 1);

			x2[l1 + 1] = MPYHIRC(co20, yt0_0) - MPYHIRC(si20, xt0_0) +
				(((MPYLUHS(co20, yt0_0) - MPYLUHS(si20, xt0_0)
					+ 0x8000) >> 16) << 1);

			x2[l2] = MPYHIRC(si30, yt2_0) + MPYHIRC(co30, xt2_0) +
				(((MPYLUHS(si30, yt2_0) + MPYLUHS(co30, xt2_0)
					+ 0x8000) >> 16) << 1);

			x2[l2 + 1] = MPYHIRC(co30, yt2_0) - MPYHIRC(si30, xt2_0) +
				(((MPYLUHS(co30, yt2_0) - MPYLUHS(si30, xt2_0)
					+ 0x8000) >> 16) << 1);
		}
	}

	/*-----------------------------------------------------------------*/
	/* The following code performs either a standard radix4 pass or a  */
	/* radix2 pass. Two pointers are used to access the input data.    */
	/* The input data is read "N/4" complex samples apart or "N/2"     */
	/* words apart using pointers "x0" and "x2". This produces out-    */
	/* puts that are 0, N/4, N/2, 3N/4 for a radix4 FFT, and 0, N/8    */
	/* N/2, 3N/8 for radix 2.                                          */
	/*-----------------------------------------------------------------*/

	y0 = ptr_y;
	y2 = ptr_y + (int)npoints;
	x0 = ptr_x;
	x2 = ptr_x + (int)(npoints >> 1);

	if (radix == 2)
	{
		/*------------------------------------------------------------*/
		/* The pointers are set at the following locations which are  */
		/* half the offsets of a radix4 FFT.                          */
		/*------------------------------------------------------------*/

		y1 = y0 + (int)(npoints >> 2);
		y3 = y2 + (int)(npoints >> 2);
		l1 = norm + 1;
		j0 = 8;
		n0 = npoints >> 1;
	}
	else
	{
		y1 = y0 + (int)(npoints >> 1);
		y3 = y2 + (int)(npoints >> 1);
		l1 = norm + 2;
		j0 = 4;
		n0 = npoints >> 2;
	}

	/*-----------------------------------------------------------------*/
	/* The following code reads data indentically for either a radix 4 */
	/* or a radix 2 style decomposition. It writes out at different    */
	/* locations though. It checks if either half the points, or a     */
	/* quarter of the complex points have been exhausted to jump to    */
	/* pervent double reversal.                                        */
	/*-----------------------------------------------------------------*/

	j = 0;

	//#ifndef NOASSUME
	//	_nassert((int)(n0) % 4 == 0);
	//	_nassert((int)(x0) % 8 == 0);
	//	_nassert((int)(x2) % 8 == 0);
	//	_nassert((int)(y0) % 8 == 0);
	//#pragma MUST_ITERATE(2,,2);
	//#endif

	for (i = 0; i < npoints; i += 8)
	{
		/*-------------------------------------------------------------*/
		/* Digit reverse the index starting from 0. The increment to   */
		/* "j" is either by 4, or 8.                                   */
		/*-------------------------------------------------------------*/

		DIG_REV(j, l1, h2);

		/*-------------------------------------------------------------*/
		/* Read in the input data, from the first eight locations.     */
		/* These are transformed either as a radix4 or as a radix 2.   */
		/*-------------------------------------------------------------*/

		x_0 = x0[0];         x_1 = x0[1];
		x_2 = x0[2];         x_3 = x0[3];
		x_4 = x0[4];         x_5 = x0[5];
		x_6 = x0[6];         x_7 = x0[7];
		x0 += 8;

		xh0_0 = x_0 + x_4; xh1_0 = x_1 + x_5;
		xl0_0 = x_0 - x_4; xl1_0 = x_1 - x_5;
		xh0_1 = x_2 + x_6; xh1_1 = x_3 + x_7;
		xl0_1 = x_2 - x_6; xl1_1 = x_3 - x_7;

		n00 = xh0_0 + xh0_1; n01 = xh1_0 + xh1_1;
		n10 = xl0_0 + xl1_1; n11 = xl1_0 - xl0_1;
		n20 = xh0_0 - xh0_1; n21 = xh1_0 - xh1_1;
		n30 = xl0_0 - xl1_1; n31 = xl1_0 + xl0_1;

		if (radix == 2)
		{
			/*--------------------------------------------------------*/
			/* Perform radix2 style decomposition.                    */
			/*--------------------------------------------------------*/

			n00 = x_0 + x_2;     n01 = x_1 + x_3;
			n20 = x_0 - x_2;     n21 = x_1 - x_3;
			n10 = x_4 + x_6;     n11 = x_5 + x_7;
			n30 = x_4 - x_6;     n31 = x_5 - x_7;
		}

		/*-------------------------------------------------------------*/
		/*  Store out the four outputs of 1 radix4 butterfly or 2      */
		/*  radix2 butterflies.                                        */
		/*-------------------------------------------------------------*/

		y0[2 * h2] = n00;            y0[2 * h2 + 1] = n01;
		y1[2 * h2] = n10;            y1[2 * h2 + 1] = n11;
		y2[2 * h2] = n20;            y2[2 * h2 + 1] = n21;
		y3[2 * h2] = n30;            y3[2 * h2 + 1] = n31;

		/*-------------------------------------------------------------*/
		/* Read in the next set of inputs from pointer "x2". These will*/
		/* produce outputs that are contiguous to the previous outputs.*/
		/*-------------------------------------------------------------*/

		x_8 = x2[0];               x_9 = x2[1];
		x_a = x2[2];               x_b = x2[3];
		x_c = x2[4];               x_d = x2[5];
		x_e = x2[6];               x_f = x2[7];
		x2 += 8;

		/*-------------------------------------------------------------*/
		/* Perform radix4 style decompositions and overwrite results   */
		/* if it is dtermined that the radix to be used is radix 2.    */
		/*-------------------------------------------------------------*/

		xh0_2 = x_8 + x_c;         xh1_2 = x_9 + x_d;
		xl0_2 = x_8 - x_c;         xl1_2 = x_9 - x_d;
		xh0_3 = x_a + x_e;         xh1_3 = x_b + x_f;
		xl0_3 = x_a - x_e;         xl1_3 = x_b - x_f;

		n02 = xh0_2 + xh0_3;       n03 = xh1_2 + xh1_3;
		n12 = xl0_2 + xl1_3;       n13 = xl1_2 - xl0_3;
		n22 = xh0_2 - xh0_3;       n23 = xh1_2 - xh1_3;
		n32 = xl0_2 - xl1_3;       n33 = xl1_2 + xl0_3;

		if (radix == 2)
		{
			n02 = x_8 + x_a;         n03 = x_9 + x_b;
			n22 = x_8 - x_a;         n23 = x_9 - x_b;
			n12 = x_c + x_e;         n13 = x_d + x_f;
			n32 = x_c - x_e;         n33 = x_d - x_f;
		}

		/*----------------------------------------------------------------*/
		/* Points that are read from succesive locations map to y, y[N/4] */
		/* y[N/2], y[3N/4] in a radix4 scheme, y, y[N/8], y[N/2],y[5N/8]  */
		/*----------------------------------------------------------------*/

		y0[2 * h2 + 2] = n02;          y0[2 * h2 + 3] = n03;
		y1[2 * h2 + 2] = n12;          y1[2 * h2 + 3] = n13;
		y2[2 * h2 + 2] = n22;          y2[2 * h2 + 3] = n23;
		y3[2 * h2 + 2] = n32;          y3[2 * h2 + 3] = n33;

		/*---------------------------------------------------------------*/
		/* Increment j by "j0", if j is equal to n0, increment j by n0,  */
		/* that double reversal is avoided.                              */
		/*---------------------------------------------------------------*/

		j += j0;

		if (j == n0)
		{
			j += n0;
			x0 += (int)npoints >> 1;
			x2 += (int)npoints >> 1;
		}
	}
}

void DSP_ifft32x32(int * ptr_w, int npoints, int * ptr_x, int * ptr_y)
{
	int   i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp;
	int   xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
	int   xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
	int   xh0_1, xh1_1, xl0_1, xl1_1;
	int   x_0, x_1, x_2, x_3, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
	int   xh0_2, xh1_2, xl0_2, xl1_2, xh0_3, xh1_3, xl0_3, xl1_3;
	int   x_4, x_5, x_6, x_7, x_h2_0, x_h2_1;
	int   x_8, x_9, x_a, x_b, x_c, x_d, x_e, x_f;
	int   si10, si20, si30, co10, co20, co30;
	int   *w;
	int   *x, *x2, *x0;
	int   *y0, *y1, *y2, *y3;
	int   n00, n10, n20, n30, n01, n11, n21, n31;
	int   n02, n12, n22, n32, n03, n13, n23, n33;
	int   n0, j0;
	int   radix;
	int   norm;
	int   m;

	/*---------------------------------------------------------------------*/
	/* Determine the magnitude od the number of points to be transformed.  */
	/* Check whether we can use a radix4 decomposition or a mixed radix    */
	/* transformation, by determining modulo 2.                            */
	/*---------------------------------------------------------------------*/

	for (i = 31, m = 1; (npoints & (1 << i)) == 0; i--, m++);
	radix = m & 1 ? 2 : 4;
	norm = m - 2;

	/*----------------------------------------------------------------------*/
	/* The stride is quartered with every iteration of the outer loop. It   */
	/* denotes the seperation between any two adjacent inputs to the butter */
	/* -fly. This should start out at N/4, hence stride is initially set to */
	/* N. For every stride, 6*stride twiddle factors are accessed. The      */
	/* "tw_offset" is the offset within the current twiddle factor sub-     */
	/* table. This is set to zero, at the start of the code and is used to  */
	/* obtain the appropriate sub-table twiddle pointer by offseting it     */
	/* with the base pointer "ptr_w".                                       */
	/*----------------------------------------------------------------------*/

	stride = npoints;
	tw_offset = 0;
	fft_jmp = 6 * stride;

	//#ifndef NOASSUME
	//	_nassert(stride > 4);
	//#pragma MUST_ITERATE(1,,1);
	//#endif

	while (stride > radix)
	{
		/*-----------------------------------------------------------------*/
		/* At the start of every iteration of the outer loop, "j" is set   */
		/* to zero, as "w" is pointing to the correct location within the  */
		/* twiddle factor array. For every iteration of the inner loop     */
		/* 6 * stride twiddle factors are accessed. For eg,                */
		/*                                                                 */
		/* #Iteration of outer loop  # twiddle factors    #times cycled    */
		/*  1                          6 N/4               1               */
		/*  2                          6 N/16              4               */
		/*  ...                                                            */
		/*-----------------------------------------------------------------*/

		j = 0;
		fft_jmp >>= 2;

		/*-----------------------------------------------------------------*/
		/* Set up offsets to access "N/4", "N/2", "3N/4" complex point or  */
		/* "N/2", "N", "3N/2" half word                                    */
		/*-----------------------------------------------------------------*/

		h2 = stride >> 1;
		l1 = stride;
		l2 = stride + (stride >> 1);

		/*-----------------------------------------------------------------*/
		/*  Reset "x" to point to the start of the input data array.       */
		/* "tw_offset" starts off at 0, and increments by "6 * stride"     */
		/*  The stride quarters with every iteration of the outer loop     */
		/*-----------------------------------------------------------------*/

		x = ptr_x;
		w = ptr_w + tw_offset;
		tw_offset += fft_jmp;

		stride >>= 2;

		/*----------------------------------------------------------------*/
		/* The following loop iterates through the different butterflies, */
		/* within a given stage. Recall that there are logN to base 4     */
		/* stages. Certain butterflies share the twiddle factors. These   */
		/* are grouped together. On the very first stage there are no     */
		/* butterflies that share the twiddle factor, all N/4 butter-     */
		/* flies have different factors. On the next stage two sets of    */
		/* N/8 butterflies share the same twiddle factor. Hence after     */
		/* half the butterflies are performed, j the index into the       */
		/* factor array resets to 0, and the twiddle factors are reused.  */
		/* When this happens, the data pointer 'x' is incremented by the  */
		/* fft_jmp amount.                                                */
		/*----------------------------------------------------------------*/

		//#ifndef NOASSUME
		//		_nassert((int)(w) % 8 == 0);
		//		_nassert((int)(x) % 8 == 0);
		//		_nassert(h2 % 8 == 0);
		//		_nassert(l1 % 8 == 0);
		//		_nassert(l2 % 8 == 0);
		//		_nassert(npoints >= 16);
		//#pragma MUST_ITERATE(4, , 1);
		//#endif

		for (i = 0; i < npoints; i += 4)
		{
			/*------------------------------------------------------------*/
			/*  Read the first three twiddle factor values. This loop co- */
			/*  mputes one radix 4 butterfly at a time.                   */
			/*------------------------------------------------------------*/

			co10 = w[j + 1];            si10 = w[j + 0];
			co20 = w[j + 3];            si20 = w[j + 2];
			co30 = w[j + 5];            si30 = w[j + 4];

			/*-----------------------------------------------------------*/
			/* Read in the data elements for the four inputs of radix4   */
			/* butterfly.                                                */
			/*-----------------------------------------------------------*/

			x_0 = x[0];            x_1 = x[1];
			x_l1_0 = x[l1];         x_l1_1 = x[l1 + 1];
			x_l2_0 = x[l2];         x_l2_1 = x[l2 + 1];
			x_h2_0 = x[h2];         x_h2_1 = x[h2 + 1];

			/*-----------------------------------------------------------*/
			/* Perform radix2 style DIF butterflies, for initial radix4  */
			/*-----------------------------------------------------------*/

			xh0_0 = x_0 + x_l1_0;
			xh1_0 = x_1 + x_l1_1;
			xl0_0 = x_0 - x_l1_0;
			xl1_0 = x_1 - x_l1_1;
			xh20_0 = x_h2_0 + x_l2_0;
			xh21_0 = x_h2_1 + x_l2_1;
			xl20_0 = x_h2_0 - x_l2_0;
			xl21_0 = x_h2_1 - x_l2_1;

			/*-----------------------------------------------------------*/
			/* Derive output pointers using the input pointer "x"        */
			/*-----------------------------------------------------------*/

			x0 = x;
			x2 = x0;

			/*-----------------------------------------------------------*/
			/* When the twiddle factors are not to be re-used, j is      */
			/* incremented by 6, to reflect the fact that 6 half words   */
			/* are consumed in every iteration. The input data pointer   */
			/* increments by 2. Note that within a stage, the stride     */
			/* does not change and hence the offsets for the other three */
			/* legs, 0, h2, l1, l2.                                      */
			/*-----------------------------------------------------------*/

			j += 6;
			x += 2;
			predj = (j - fft_jmp);
			if (!predj) x += fft_jmp;
			if (!predj) j = 0;

			/*----------------------------------------------------------*/
			/* These four partial results can be re-written to show     */
			/* the underlying DIF structure similar to radix2 as        */
			/* follows:                                                 */
			/*                                                          */
			/* X(4k)  = (x(n)+x(n + N/2)) + (x(n+N/4)+ x(n + 3N/4))     */
			/* X(4k+1)= (x(n)-x(n + N/2)) -j(x(n+N/4) - x(n + 3N/4))    */
			/* x(4k+2)= (x(n)+x(n + N/2)) - (x(n+N/4)+ x(n + 3N/4))     */
			/* X(4k+3)= (x(n)-x(n + N/2)) +j(x(n+N/4) - x(n + 3N/4))    */
			/*                                                          */
			/* which leads to the real and imaginary values as foll:    */
			/*                                                          */
			/* y0r = x0r + x2r +  x1r +  x3r    =  xh0 + xh20           */
			/* y0i = x0i + x2i +  x1i +  x3i    =  xh1 + xh21           */
			/* y1r = x0r - x2r + (x1i -  x3i)   =  xl0 + xl21           */
			/* y1i = x0i - x2i - (x1r -  x3r)   =  xl1 - xl20           */
			/* y2r = x0r + x2r - (x1r +  x3r)   =  xh0 - xh20           */
			/* y2i = x0i + x2i - (x1i +  x3i    =  xh1 - xh21           */
			/* y3r = x0r - x2r - (x1i -  x3i)   =  xl0 - xl21           */
			/* y3i = x0i - x2i + (x1r -  x3r)   =  xl1 + xl20           */
			/* ---------------------------------------------------------*/

			x0[0] = xh0_0 + xh20_0;       x0[1] = xh1_0 + xh21_0;
			xt0_0 = xh0_0 - xh20_0;       yt0_0 = xh1_0 - xh21_0;
			xt1_0 = xl0_0 - xl21_0;       yt2_0 = xl1_0 - xl20_0;
			xt2_0 = xl0_0 + xl21_0;       yt1_0 = xl1_0 + xl20_0;

			/*-----------------------------------------------------------*/
			/* The following multiplies are close to a true 32 by 32     */
			/* multiply instruction.                                     */
			/* Perform twiddle factor multiplies of three terms,top      */
			/* term does not have any multiplies. Note the twiddle       */
			/* factors for a normal FFT are C + j (-S). Since the        */
			/* factors that are stored are C + j S, this is              */
			/* corrected for in the multiplies.                          */
			/*                                                           */
			/* Y1 = (xt1 + jyt1) (c + js) = (xc + ys) + (yc -xs)         */
			/* There is a loss of 1.5 bits of accuracy. This arises be-  */
			/* cause the result of the low sixteen by sixteen bits is    */
			/* not computed and the multiply of the low by high is       */
			/* shifted by 16, and results in a loss of 1 bit.            */
			/* Multiplies are performed for all the three legs of the    */
			/* radix4 butterfly are performed. In addition note that     */
			/* themiddle two legs are swapped. This is based on work     */
			/* done by Panos Papamichalis, on obtaining bit reversed     */
			/* order from a radix 4 butterfly. This allows the last      */
			/* stage to be performed either as a radix4 or a radix2      */
			/* pass for this stage.                                      */
			/*-----------------------------------------------------------*/

			x2[h2] = MPYHIRC(co10, xt1_0) - MPYHIRC(si10, yt1_0) +
				(((MPYLUHS(co10, xt1_0) - MPYLUHS(si10, yt1_0)
					+ 0x8000) >> 16) << 1);

			x2[h2 + 1] = MPYHIRC(co10, yt1_0) + MPYHIRC(si10, xt1_0) +
				(((MPYLUHS(co10, yt1_0) + MPYLUHS(si10, xt1_0)
					+ 0x8000) >> 16) << 1);

			x2[l1] = MPYHIRC(co20, xt0_0) - MPYHIRC(si20, yt0_0) +
				(((MPYLUHS(co20, xt0_0) - MPYLUHS(si20, yt0_0)
					+ 0x8000) >> 16) << 1);

			x2[l1 + 1] = MPYHIRC(co20, yt0_0) + MPYHIRC(si20, xt0_0) +
				(((MPYLUHS(co20, yt0_0) + MPYLUHS(si20, xt0_0)
					+ 0x8000) >> 16) << 1);

			x2[l2] = MPYHIRC(co30, xt2_0) - MPYHIRC(si30, yt2_0) +
				(((MPYLUHS(co30, xt2_0) - MPYLUHS(si30, yt2_0)
					+ 0x8000) >> 16) << 1);

			x2[l2 + 1] = MPYHIRC(co30, yt2_0) + MPYHIRC(si30, xt2_0) +
				(((MPYLUHS(co30, yt2_0) + MPYLUHS(si30, xt2_0)
					+ 0x8000) >> 16) << 1);
		}
	}

	/*-----------------------------------------------------------------*/
	/* The following code performs either a standard radix4 pass or a  */
	/* radix2 pass. Two pointers are used to access the input data.    */
	/* The input data is read "N/4" complex samples apart or "N/2"     */
	/* words apart using pointers "x0" and "x2". This produces out-    */
	/* puts that are 0, N/4, N/2, 3N/4 for a radix4 FFT, and 0, N/8    */
	/* N/2, 3N/8 for radix 2.                                          */
	/*-----------------------------------------------------------------*/

	y0 = ptr_y;
	y2 = ptr_y + (int)npoints;
	x0 = ptr_x;
	x2 = ptr_x + (int)(npoints >> 1);

	if (radix == 2)
	{
		/*------------------------------------------------------------*/
		/* The pointers are set at the following locations which are  */
		/* half the offsets of a radix4 FFT.                          */
		/*------------------------------------------------------------*/

		y1 = y0 + (int)(npoints >> 2);
		y3 = y2 + (int)(npoints >> 2);
		l1 = norm + 1;
		j0 = 8;
		n0 = npoints >> 1;
	}
	else
	{
		y1 = y0 + (int)(npoints >> 1);
		y3 = y2 + (int)(npoints >> 1);
		l1 = norm + 2;
		j0 = 4;
		n0 = npoints >> 2;
	}

	/*-----------------------------------------------------------------*/
	/* The following code reads data indentically for either a radix 4 */
	/* or a radix 2 style decomposition. It writes out at different    */
	/* locations though. It checks if either half the points, or a     */
	/* quarter of the complex points have been exhausted to jump to    */
	/* pervent double reversal.                                        */
	/*-----------------------------------------------------------------*/

	j = 0;

	//#ifndef NOASSUME
	//	_nassert((int)(n0) % 4 == 0);
	//	_nassert((int)(x0) % 8 == 0);
	//	_nassert((int)(x2) % 8 == 0);
	//	_nassert((int)(y0) % 8 == 0);
	//#pragma MUST_ITERATE(2,,2);
	//#endif

	for (i = 0; i < npoints; i += 8)
	{
		/*-------------------------------------------------------------*/
		/* Digit reverse the index starting from 0. The increment to   */
		/* "j" is either by 4, or 8.                                   */
		/*-------------------------------------------------------------*/

		DIG_REV(j, l1, h2);

		/*-------------------------------------------------------------*/
		/* Read in the input data, from the first eight locations.     */
		/* These are transformed either as a radix4 or as a radix 2.   */
		/*-------------------------------------------------------------*/

		x_0 = x0[0];         x_1 = x0[1];
		x_2 = x0[2];         x_3 = x0[3];
		x_4 = x0[4];         x_5 = x0[5];
		x_6 = x0[6];         x_7 = x0[7];
		x0 += 8;

		xh0_0 = x_0 + x_4; xh1_0 = x_1 + x_5;
		xl0_0 = x_0 - x_4; xl1_0 = x_1 - x_5;
		xh0_1 = x_2 + x_6; xh1_1 = x_3 + x_7;
		xl0_1 = x_2 - x_6; xl1_1 = x_3 - x_7;

		n00 = xh0_0 + xh0_1; n01 = xh1_0 + xh1_1;
		n20 = xh0_0 - xh0_1; n21 = xh1_0 - xh1_1;
		n10 = xl0_0 - xl1_1; n11 = xl1_0 + xl0_1;
		n30 = xl0_0 + xl1_1; n31 = xl1_0 - xl0_1;

		if (radix == 2)
		{
			/*--------------------------------------------------------*/
			/* Perform radix2 style decomposition.                    */
			/*--------------------------------------------------------*/

			n00 = x_0 + x_2;     n01 = x_1 + x_3;
			n20 = x_0 - x_2;     n21 = x_1 - x_3;
			n10 = x_4 + x_6;     n11 = x_5 + x_7;
			n30 = x_4 - x_6;     n31 = x_5 - x_7;
		}

		/*-------------------------------------------------------------*/
		/*  Store out the four outputs of 1 radix4 butterfly or 2      */
		/*  radix2 butterflies.                                        */
		/*-------------------------------------------------------------*/

		y0[2 * h2] = n00;            y0[2 * h2 + 1] = n01;
		y1[2 * h2] = n10;            y1[2 * h2 + 1] = n11;
		y2[2 * h2] = n20;            y2[2 * h2 + 1] = n21;
		y3[2 * h2] = n30;            y3[2 * h2 + 1] = n31;

		/*-------------------------------------------------------------*/
		/* Read in the next set of inputs from pointer "x2". These will*/
		/* produce outputs that are contiguous to the previous outputs.*/
		/*-------------------------------------------------------------*/

		x_8 = x2[0];               x_9 = x2[1];
		x_a = x2[2];               x_b = x2[3];
		x_c = x2[4];               x_d = x2[5];
		x_e = x2[6];               x_f = x2[7];
		x2 += 8;

		/*-------------------------------------------------------------*/
		/* Perform radix4 style decompositions and overwrite results   */
		/* if it is dtermined that the radix to be used is radix 2.    */
		/*-------------------------------------------------------------*/

		xh0_2 = x_8 + x_c;         xh1_2 = x_9 + x_d;
		xl0_2 = x_8 - x_c;         xl1_2 = x_9 - x_d;
		xh0_3 = x_a + x_e;         xh1_3 = x_b + x_f;
		xl0_3 = x_a - x_e;         xl1_3 = x_b - x_f;

		n02 = xh0_2 + xh0_3;       n03 = xh1_2 + xh1_3;
		n12 = xl0_2 - xl1_3;       n13 = xl1_2 + xl0_3;
		n22 = xh0_2 - xh0_3;       n23 = xh1_2 - xh1_3;
		n32 = xl0_2 + xl1_3;       n33 = xl1_2 - xl0_3;

		if (radix == 2)
		{
			n02 = x_8 + x_a;         n03 = x_9 + x_b;
			n22 = x_8 - x_a;         n23 = x_9 - x_b;
			n12 = x_c + x_e;         n13 = x_d + x_f;
			n32 = x_c - x_e;         n33 = x_d - x_f;
		}

		/*----------------------------------------------------------------*/
		/* Points that are read from succesive locations map to y, y[N/4] */
		/* y[N/2], y[3N/4] in a radix4 scheme, y, y[N/8], y[N/2],y[5N/8]  */
		/*----------------------------------------------------------------*/

		y0[2 * h2 + 2] = n02;          y0[2 * h2 + 3] = n03;
		y1[2 * h2 + 2] = n12;          y1[2 * h2 + 3] = n13;
		y2[2 * h2 + 2] = n22;          y2[2 * h2 + 3] = n23;
		y3[2 * h2 + 2] = n32;          y3[2 * h2 + 3] = n33;

		/*---------------------------------------------------------------*/
		/* Increment j by "j0", if j is equal to n0, increment j by n0,  */
		/* that double reversal is avoided.                              */
		/*---------------------------------------------------------------*/

		j += j0;

		if (j == n0)
		{
			j += n0;
			x0 += (int)npoints >> 1;
			x2 += (int)npoints >> 1;
		}
	}
}
//      rectsrc, imgd, w, h, rectdst, windowdata
//                扩大后的坐标位置   送入的灰度图
void imgwarp(int * rectsrc, unsigned char *src, int width, int hight, int * rectdst, unsigned char*dst)
{//left right up down
	int i, j;
	int x, y, px1, px2, py1, py2;
	int p1, p2, p3, p4, sx, sy;
	int ww, hh;
	int w, h;
	int Width, Hight;
	w = (rectdst[1] - rectdst[0] + 1);//512
	h = (rectdst[3] - rectdst[2] + 1);
	Width = rectsrc[1] - rectsrc[0] + 1;
	Hight = rectsrc[3] - rectsrc[2] + 1;
	ww = w * 1024;
	hh = h * 1024;
	if (w == 640 && h == 640)
	{
		/*for (j = 0; j < hh; j = j + 1024)//w=64 h=64
		for (i = 0; i < ww; i = i + 1024)
		{
		x = ((i * Width) >> 6)/10+(rectsrc[0]<<10);
		y = ((j * Hight) >> 6)/10+(rectsrc[2]<<10);
		sx = (x & 0xFFFFFC00);
		sy = (y & 0xFFFFFC00);
		if (sx < 0 || sx >= ((width-1) << 10) || sy < 0 || sy >= ((hight-1) << 10))continue;
		px1 = x - sx;
		py1 = y - sy;
		px2 = 1024 - px1;
		py2 = 1024 - py1;
		p1 = (sy >> 10) * width + (sx >> 10);
		temp2 = py2 * px2 * src[p1];
		p2 = p1 + 1;
		temp1 = py2 * px1 * src[p2];
		p3 = p1 + width;
		temp4 = py1 * px2 * src[p3];
		p4 = p1 + width + 1;
		temp3 = py1 * px1 * src[p4];
		dst[(j >> 10) * w + (i >> 10)] = ((temp1 + temp2 + temp3 + temp4) >> 20);
		}*/
		ww = w * 1;
		hh = h * 1;
		/*for (j = 0; j < hh; j = j + 1)//w=64 h=64
		for (i = 0; i < ww; i = i + 1)
		{
		sx = (i * Width)/640 + rectsrc[0];
		sy = (j * Hight)/640 + rectsrc[2];
		if (sx < 0 || sx >= ((width - 1) ) || sy < 0 || sy >= ((hight - 1) ))continue;
		p1 = (sy ) * width + (sx );
		dst[(j) * w + (i)] = src[p1];
		}*/
		int sy[640] = { 0 };
		int sx[640] = { 0 };
		for (j = 0; j < hh; j = j + 1)//w=64 h=64
		{
			sy[j] = (j * Hight) / 640 + rectsrc[2];
			sy[j] = (sy[j]<0 || sy[j]>(hight - 1)) ? 0 : sy[j];
		}
		std::cout << "II:";
		for (int ii = 0; ii < 640; ii++) {
			std::cout << ":" << sy[ii];
		}
		std::cout << std::endl;
		for (i = 0; i < ww; i = i + 1)
		{
			sx[i] = (i * Width) / 640 + rectsrc[0];
			sx[i] = (sx[i]<0 || sx[i]>(width - 1)) ? 0 : sx[i];
		}
		for (j = 0; j < hh; j = j + 1)//w=64 h=64
			for (i = 0; i < ww; i = i + 8)
			{
				dst[j * w + i] = src[sy[j] * width + sx[i]];
				dst[j * w + i + 1] = src[sy[j] * width + sx[i + 1]];
				dst[j * w + i + 2] = src[sy[j] * width + sx[i + 2]];
				dst[j * w + i + 3] = src[sy[j] * width + sx[i + 3]];
				dst[j * w + i + 4] = src[sy[j] * width + sx[i + 4]];
				dst[j * w + i + 5] = src[sy[j] * width + sx[i + 5]];
				dst[j * w + i + 6] = src[sy[j] * width + sx[i + 6]];
				dst[j * w + i + 7] = src[sy[j] * width + sx[i + 7]];
			}

	}
	else
	{
		for (j = 0; j < hh; j = j + 1024)
			for (i = 0; i < ww; i = i + 1024)
			{
				x = ((i * Width) / w) + (rectsrc[0] << 10);
				y = ((j * Hight) / h) + (rectsrc[2] << 10);
				//低10位清零 把尺寸变成1024的整数倍 
				sx = (x & 0xFFFFFC00);
				sy = (y & 0xFFFFFC00);

				if (sx < 0 || sx >= ((width - 1) << 10) || sy < 0 || sy >= ((hight - 1) << 10))continue;//y 1024 x 492544 进入下有一步
				//这个px1 py1 px2 py2就是目标图像位置相当于原图像位置的偏移量
				px1 = x - sx;//0 计算当前位置在sx上的偏移
				py1 = y - sy;//0
				px2 = 1024 - px1;//计算当前位置在sx+1024上的偏移
				py2 = 1024 - py1;
				p1 = (sy >> 10) * width + (sx >> 10);//原始图像对应位置的索引
				p2 = p1 + 1; //相邻位置的索引
				p3 = p1 + width;
				p4 = p1 + width + 1;
				dst[(j >> 10) * w + (i >> 10)] = ((py2 * ((px1 * src[p2] + px2 * src[p1])) + py1 * ((px1 * src[p4] + px2 * src[p3]))) >> 20);
			}
	}
}
//                                  backgroundtemp, (768), (1024), (volatile int*)(&targetpos[0]), (volatile int*)(&targetsize[0]), (volatile int*)(&trackstatus[0]))
void fdsst(volatile int* trackflag, unsigned char* imgd, int w, int h, volatile int* targetpos, volatile int* targetsize, volatile int* trackstatus)
{//left right up down
	// 这里我理解他送进来是 原图和 目标的中心坐标
	//初始化框 设置搜索的区域
	if (*trackflag == 1) //跟踪状态，初始化参数
	{
		int rectsrc[4] = { 0 }, rectdst[4] = { 0 };


		int left = 0, right = w - 1, up = 0, down = h - 1;
		std::cout << "max_scale_factor:" << max_scale_factor << std::endl; //8
		//对宽高都乘以8 x 2 不知是否是为了扩大搜索范围？
		init_patch_sz[0] = 2 * targetsize[0] * max_scale_factor;
		init_patch_sz[1] = 2 * targetsize[1] * max_scale_factor;
		//避免尺寸过小
		std::cout << "init_patch_sz:" << init_patch_sz[0] << std::endl;
		init_patch_sz[0] = init_patch_sz[0] < 1 ? 2 : init_patch_sz[0];
		init_patch_sz[1] = init_patch_sz[1] < 1 ? 2 : init_patch_sz[1];

		//把扩大后的中心点坐标转换成顶点坐标
		left = floor(targetpos[1] + 1 - floor(init_patch_sz[1] / 2)) - 0;
		right = floor(targetpos[1] + init_patch_sz[1] - floor(init_patch_sz[1] / 2)) - 0;
		up = floor(targetpos[0] + 1 - floor(init_patch_sz[0] / 2)) - 0;
		down = floor(targetpos[0] + init_patch_sz[0] - floor(init_patch_sz[0] / 2)) - 0;
		rectsrc[0] = left;
		rectsrc[1] = right;
		rectsrc[2] = up;
		rectsrc[3] = down;

		rectdst[0] = 0;
		rectdst[1] = 2 * SIZE * max_scale_factor - 1;//
		rectdst[2] = 0;
		rectdst[3] = 2 * SIZE * max_scale_factor - 1;
		//      扩大后的坐标 原灰度图 初始化数组  数组32x32x10x10x2x2
		imgwarp(rectsrc, imgd, w, h, rectdst, windowdata);
		//测试一下图片现在是什么样子的

		//Mat	img;
		//img.create(2 * SIZE * 10, 2 * SIZE * 10, CV_8UC1);
		//int w = 2 * SIZE * 10, h = 2 * SIZE * 10;
		//img.cols = w;
		//img.rows = h;
		
		//memcpy(img.data, windowdata, 2 * SIZE * 10 * 2 * SIZE * 10);
		//imshow("windowdata", img);
		//waitKey(10000);
		
		input_target_pos[0] = 2 * SIZE * max_scale_factor / 2;
		input_target_pos[1] = 2 * SIZE * max_scale_factor / 2;
		targetsize[0] = SIZE;
		targetsize[1] = SIZE;
	}
	else
	{
		int rectsrc[4] = { 0 }, rectdst[4] = { 0 };
	
		
		int left = 0, right = w - 1, up = 0, down = h - 1;

		left = floor(targetpos[1] + 1 - floor(init_patch_sz[1] / 2)) - 0;
		right = floor(targetpos[1] + init_patch_sz[1] - floor(init_patch_sz[1] / 2)) - 0;
		up = floor(targetpos[0] + 1 - floor(init_patch_sz[0] / 2)) - 0;
		down = floor(targetpos[0] + init_patch_sz[0] - floor(init_patch_sz[0] / 2)) - 0;
		rectsrc[0] = left;
		rectsrc[1] = right;
		rectsrc[2] = up;
		rectsrc[3] = down;

		rectdst[0] = 0;
		rectdst[1] = 2 * SIZE * max_scale_factor - 1;
		rectdst[2] = 0;
		rectdst[3] = 2 * SIZE * max_scale_factor - 1;
		imgwarp(rectsrc, imgd, w, h, rectdst, windowdata);
		//std::cout << "windowdata:" << sizeof(windowdata) << std::endl;
		//.........................0
		//Mat	img(2 * SIZE * 10, 2 * SIZE * 10, CV_8UC1);
	
		//int w = 2 * SIZE * 10, h = 2 * SIZE * 10;
		//img.cols = w;
		//img.rows = h;
		//for (int n = 0; n < h; n++)
		//	for (int m = 0; m < w; m++)
		//	{
		//		img.data[n * w *  +  m + 0] = windowdata[(n * w + m)];// pGrayImg->imageData[(n * w + m)];

		//	}
		//char dstname[200] = { 0 };
		//imshow("img2", img);
		//waitKey(10000000);
		//.........................1


	}
	dsst(trackflag, windowdata, 2 * SIZE * max_scale_factor, 2 * SIZE * max_scale_factor, (volatile int*)(&input_target_pos[0]), (volatile int*)(&targetsize[0]), (volatile int*)(&trackstatus[0]));
	targetpos[0] = (input_target_pos[0] - 2 * SIZE * max_scale_factor / 2) * init_patch_sz[0] / (2 * SIZE * max_scale_factor) + targetpos[0];
	targetpos[1] = (input_target_pos[1] - 2 * SIZE * max_scale_factor / 2) * init_patch_sz[1] / (2 * SIZE * max_scale_factor) + targetpos[1];
	trackstatus[1] = (trackstatus[0] == 1) ? h / 2 - targetpos[0] : 0;
	trackstatus[2] = (trackstatus[0] == 1) ? targetpos[1] - w / 2 : 0;
	trackstatus[3] = trackstatus[3] * init_patch_sz[0] / (2 * SIZE*max_scale_factor);
	trackstatus[4] = trackstatus[4] * init_patch_sz[1] / (2 * SIZE * max_scale_factor);
}

void dsst(volatile int * trackflag, unsigned char *imgd, int w, int h, volatile int *targetpos, volatile int *targetsize, volatile int *trackstatus)
{
	int i, j, k;
	int * inttempsimg = (int *)im_patch;
	if (*trackflag == 1)  //跟踪状态
	{
		pos[0] = floor(targetpos[0]);
		pos[1] = floor(targetpos[1]);
		init_target_sz[0] = targetsize[0];
		init_target_sz[1] = targetsize[1];
		base_target_sz[0] = targetsize[0];//32
		base_target_sz[1] = targetsize[1];//32
		sz[0] = floor((padding + 1)*base_target_sz[0]);//64
		sz[1] = floor((padding + 1)*base_target_sz[1]);
		output_sigma = output_sigma_factor*sqrt((base_target_sz[0] * 1.0 / featureRatio)*(base_target_sz[1] * 1.0 / featureRatio));//0.5   
		//featureRatio=4  output_sigma_factor=0.0625
		//output_sigma = output_sigma_factor*sqrt((base_target_sz[0] * 1.0 / featureRatio)*(base_target_sz[1] * 1.0 / featureRatio));//0.5   
		use_sz[0] = floor(sz[0] * 1.0 / featureRatio);//16
		use_sz[1] = floor(sz[1] * 1.0 / featureRatio);
		interp_sz[0] = use_sz[0] * featureRatio;
		interp_sz[1] = use_sz[1] * featureRatio;
		scale_sigma = nScalesInterp *scale_sigma_factor;

		for (i = 0; i < nScales; i++) //尺度数 17 
			scaleSizeFactors[i] = pow((scale_step), (i - floor((nScales - 1) / 2)) * nScalesInterp / nScales);
		for (i = 0; i <= floor((nScalesInterp - 1) / 2); i++)
		{
			interpScaleFactors[i] = pow((scale_step), i);
		}
		for (i = 0; i < floor((nScalesInterp - 1) / 2); i++)
		{
			interpScaleFactors[i + 1 + (int)((nScalesInterp - 1) / 2)] = pow((scale_step), (i - floor((nScalesInterp - 1) / 2)));
		}
		Hann(nScales, scale_window);//33个内插尺度变化因子 --- 削弱特征边缘，突出中心特征
		if (init_target_sz[0] * init_target_sz[1]>scale_model_max_area)
			scale_model_factor = sqrt(scale_model_max_area / (init_target_sz[0] * init_target_sz[1]));
		scale_model_sz[0] = floor(init_target_sz[0] * scale_model_factor);
		scale_model_sz[1] = floor(init_target_sz[1] * scale_model_factor);
		min_scale_factor = 0.1;// pow(scale_step, ceil(log(mmax(5 / sz[0], 5 / sz[1])) / log(scale_step)));
		max_scale_factor =  8;// pow(scale_step, floor(log(mmin(h / base_target_sz[0], w / base_target_sz[1])) / log(scale_step)));
		*trackflag = 0; frame = 0; maxconfidences = VAR_CON; lasting_lostframes = 0; currentScaleFactor = 1; framelimit = 0;
	}

	//在后面的主要思路就是提取特征----
	//循环（训练得到模型参数，提取下一帧图像patch的特征，利用训练好的模型计算响应，得到下一帧的位置和尺度）

	if (*trackflag == 0)
	{
		//特征检测 --- 和KCF一样，用一个滤波器进行跟踪，得到目标的位置
		if ((frame++ >= 1)/*&& (framelimit++<500000)*/)
		{
			/************************************** 1、位置检测 *************************/
			maxconfidences = 0;
			for (k = 0; k<5; k++) //在相邻区域内查找 nbpos
			{
				pos_temp[0] = h / 2 + nbpos[k][0]; // 图像位置 h
				pos_temp[1] = w / 2 + nbpos[k][1];
				//1-1  提取待检测图像块（im_patch）的灰度特征  16*16 --- cos_window 滤波 ---- 得xl
				get_translation_sample(w, h, imgd, pos_temp, sz, currentScaleFactor, cos_window, xl);//input cos_window output xl8192
																									 //1-2  FFT 变换，得到像素位置的频域特征 --- 降维1/4，减小计算量
				fft2(xl, xlf, sz[0] / 4, sz[1] / 4);//512
													//1-3 计算频域特征值大小--- 降采样 16*32
				for (i = 0; i < sz[0] / 4; i++) //16
				{
					for (j = 0; j<sz[1] / 2; j = j + 2) //32
					{
						freal = multiply(hf_num[i*sz[1] / 2 + j], xlf[i*sz[1] / 2 + j], 8) - multiply(hf_num[i*sz[1] / 2 + j + 1], xlf[i*sz[1] / 2 + j + 1], 8);// hf_num[512] xlf[512]
						fimag = multiply(hf_num[i*sz[1] / 2 + j], xlf[i*sz[1] / 2 + j + 1], 8) + multiply(hf_num[i*sz[1] / 2 + j + 1], xlf[i*sz[1] / 2 + j], 8);
						inttempsimg[i*sz[1] / 2 + j] = 16384 * (freal / ((hf_den[i*sz[1] / 4 + (j >> 1)] >> 3) + lambda));
						inttempsimg[i*sz[1] / 2 + j + 1] = 16384 * (fimag / ((hf_den[i*sz[1] / 4 + (j >> 1)] >> 3) + lambda));//16384
					}
				}
				//1-4 特征因子尺寸归一化--- 得特征矩阵
				//内插分出了相应的向量 --- 64*64 维
				memset(inttempsimg + (interp_sz[0] * interp_sz[1] * 2), 0, interp_sz[0] * interp_sz[1] * 2 * sizeof(int));
				//快速离散傅里叶变换 ---- 归一化特征矩阵尺寸大小
				resizeDFT2(sz[0] / 4, sz[1] / 2, inttempsimg, interp_sz[0], interp_sz[1] * 2, inttempsimg + (interp_sz[0] * interp_sz[1] * 2));
				//1-5 快速傅里叶逆变换 ---尺寸 64*64*2 -- 变换到时域（像素位置） 
				ifft2(inttempsimg + (interp_sz[0] * interp_sz[1] * 2), inttempsimg, sz[0], sz[1]);

				//1-6 查找最大特征点的位置 --- 
				maxresponse = 0; row = 0; col = 0;
				for (i = 0; i < sz[0]; i++) //图像h
				{
					for (j = 0; j<sz[1]; j = j + 1) //图像w
					{
						if (maxresponse<inttempsimg[i*sz[1] + j])
						{
							maxresponse = inttempsimg[i*sz[1] + j];
							row = i;
							col = j;
						}
					}
				}

				/*	    		for(i=0;i<sz[0];i++)
				for(j=0;j<sz[1];j=j+1)
				tempimg[i*sz[1]+j]=inttempsimg[i*sz[1]+j]>=0?255*(inttempsimg[i*sz[1]+j]*1.0/maxresponse):0;
				*/
				//1-7 获取位置 --- 计算相关度
				confidences = forconfidence(inttempsimg, col, row, sz[1], sz[0], maxresponse);
				//1-8 更新目标像素位置
				if (maxconfidences<confidences)
				{
					maxconfidences = confidences;
					row_con = pos_temp[0] + round(((row + (int)(floor((interp_sz[0] - 1) / 2))) % interp_sz[0] - floor((interp_sz[0] - 1) / 2))*currentScaleFactor);
					col_con = pos_temp[1] + round(((col + (int)(floor((interp_sz[1] - 1) / 2))) % interp_sz[1] - floor((interp_sz[1] - 1) / 2))*currentScaleFactor);
				}
			}

			/***************************************** 2、 尺度检测*********************************************************************************************/
			//----在目标位置的基础上通过调整跟踪框的比例来找到响应值最大的尺度，从而在小范围内实现尺度自适应。
			if (maxconfidences >= VAR_CON) //
			{
				pos[0] = row_con;
				pos[1] = col_con;
				memset(xs, 0, 144 * 32 * sizeof(int));
				//2-1 获取尺度像素特征因子
				get_scale_sample(w, h, imgd, pos, base_target_sz, currentScaleFactor, scaleSizeFactors, scale_window, scale_model_sz, xs);
				//2-2 fft 变换，得频率特征
				{
					int xsinput[17 * 17] = { 0 };
					int k = 0;
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
							for (j = 0; j < 144; j = j + 1)
								xsinput[i * 17 + k] += (xs[17 * j + k] * scale_basis[17 * j + i]) >> 5;//1024*32
					}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
							xsinput[i * 17 + k] = xsinput[i * 17 + k] >> 5;//1024
					}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
						{
							xsinput[i * 17 + k] = (xsinput[i * 17 + k] * scale_window[k]) >> 10;//1024
						}
						fft(xsinput + i * 17, xsf + i * 2 * 17, 17);//1024*1024 获取尺度因子
					}
				}
				//2-3 计算17x17 矩阵单位的 尺度因子的大小
				for (i = 0; i<int(nScales); i++)
				{
					sumreal = 0; sumimag = 0;
					for (j = 0; j<int(nScales); j++)
					{
						sumreal += multiply(sf_num[2 * int(nScales) *j + i * 2 + 0], xsf[2 * int(nScales) *j + i * 2 + 0], 11) - multiply(sf_num[2 * int(nScales) *j + i * 2 + 1], xsf[2 * int(nScales) *j + i * 2 + 1], 11);//  *1024
						sumimag += multiply(sf_num[2 * int(nScales) *j + i * 2 + 0], xsf[2 * int(nScales) *j + i * 2 + 1], 11) + multiply(sf_num[2 * int(nScales) *j + i * 2 + 1], xsf[2 * int(nScales) *j + i * 2 + 0], 11);
					}
					inttempsimg[2 * i] = sumreal / (sf_den[i] + 1);
					inttempsimg[2 * i + 1] = sumimag / (sf_den[i] + 1);// 1*36
				}
				//2-4 特征因子尺寸归一化 --- 得特征矩阵
				memset(inttempsimg + (interp_sz[0] * interp_sz[1] * 2), 0, interp_sz[0] * interp_sz[1] * 2 * sizeof(int));
				resizeDFT(int(nScales), inttempsimg, int(nScalesInterp), inttempsimg + (interp_sz[0] * interp_sz[1] * 2));
				//2-5 反变换得 33维 插值尺寸因子
				ifft(inttempsimg + (interp_sz[0] * interp_sz[1] * 2), inttempsimg, int(nScalesInterp));

				//2-6 找到响应值最大所对应的尺度因子 --- 新尺度因子
				maxscaleresponse = 0;
				for (i = 0; i<int(nScalesInterp); i++)
				{
					if (maxscaleresponse<inttempsimg[2 * i])
					{
						maxscaleresponse = inttempsimg[2 * i];
						recovered_scale = i;
					}
				}
				//2-7 尺度因子自适应变化
				currentScaleFactor = currentScaleFactor*interpScaleFactors[recovered_scale];//mark check --- window size
				currentScaleFactor = currentScaleFactor<min_scale_factor ? min_scale_factor : (currentScaleFactor>max_scale_factor ? max_scale_factor : currentScaleFactor);
			}
		}

		/************************************************ 3、训练 （3.1位置、 3.2尺度）*****************************************************************/
		if (maxconfidences >= VAR_CON)
		{
			//3.1 位置训练
			//3-1-1 利用 cos_window 获取特征变换矩阵 xl
			get_translation_sample(w, h, imgd, pos, sz, currentScaleFactor, cos_window, xl);//input cos_window  ， output xl = 16x16
																							//3-1-2 特征更新，使模型对于跟踪目标的鲁棒性变强
			if (frame == 1)
			{
				for (i = 0; i < (2 * SIZE * 2 * SIZE) / 16; i++) //256维
					h_num_xl[i] = xl[i];
			}
			else if (frame > 1)
			{
				for (i = 0; i < (2 * SIZE * 2 * SIZE) / 16; i++) //256维
					h_num_xl[i] = h_num_xl[i] - (h_num_xl[i] - xl[i]) * 0.025;
			}
			//3-1-3 获取位置频域特征
			fft2(xl, xlf, 2 * SIZE / 4, 2 * SIZE / 4); // xlf --- xl的 fft变换
			fft2(h_num_xl, h_num_xlf, 2 * SIZE / 4, 2 * SIZE / 4);
			//3-1-4 计算位置特征因子数值
			for (i = 0; i < 2 * SIZE / 4; i++)  //16
			{
				for (j = 0; j<2 * SIZE / 2; j = j + 2) //32
				{
					hf_num[i * 2 * SIZE / 2 + j] = multiply(yf[i * 2 * SIZE / 4 + (j >> 1)], h_num_xlf[i * 2 * SIZE / 2 + j], 15);
					hf_num[i * 2 * SIZE / 2 + j + 1] = -multiply(yf[i * 2 * SIZE / 4 + (j >> 1)], h_num_xlf[i * 2 * SIZE / 2 + j + 1], 15);//  *64
				}
			}
			for (i = 0; i < 2 * SIZE / 4; i++) //16
			{
				for (j = 0; j<2 * SIZE / 2; j = j + 2) //32
				{
					new_hf_den[i * 2 * SIZE / 4 + (j >> 1)] = multiply(xlf[i * 2 * SIZE / 2 + j], xlf[i * 2 * SIZE / 2 + j], 8) + multiply(xlf[i * 2 * SIZE / 2 + j + 1], xlf[i * 2 * SIZE / 2 + j + 1], 8);//  /32
				}
			}

			////3-2-1 获取尺度特征矩阵 xs 
			memset(xs,0,144*32*sizeof(int));
			get_scale_sample(w,h,imgd,pos,base_target_sz,currentScaleFactor,scaleSizeFactors,scale_window,scale_model_sz,xs);//16384*64
			////3-2-2 特征更新，使模型对于跟踪目标的鲁棒性变强	//ZXL 这里变得不一样了
				if (frame == 1)
				{
					for (i = 0; i < 144 * nScales; i++)
						xs_num[i] = xs[i];
				}
				if (frame > 1)
				{
					for (i = 0; i < 144 * nScales; i++)
						xs_num[i] = xs_num[i]-(xs_num[i]-xs[i])*0.025;
				}
				//}
			////3-2-3 特征降维 ---- 奇异值分解得到pca变换矩阵 -- scale_basis 、scale_basis_den --- 17维 ZXL 
			schmidt(xs_num, int(nScales), 144, scale_basis);//1024
			schmidt(xs, int(nScales), 144, scale_basis_den);//1024
			////3-2-4 降维后的尺度特征矩阵处理
			{
					int xsinput[17 * 17] = { 0 };
					int k = 0;
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
							for (j = 0; j < 144; j = j + 1)
								xsinput[i * 17 + k] += (xs_num[17 * j + k] * scale_basis[17 * j + i]) >> 5;//1024*32

					}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
								xsinput[i * 17 + k] = xsinput[i * 17 + k] >> 5;//1024
								
													}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
						{
							xsinput[i * 17 + k] = (xsinput[i * 17 + k] * scale_window[k])>>10; //17*17的降维后的特征矩阵和一个一维的汉明窗进行相乘
						}
						fft(xsinput+i*17, sf + i * 2 * 17, 17);//1024*1024
					}
				}		
				for (i = 0; i < int(nScales); i++) //17
				{
					for (j = 0; j < int(nScales); j++) //17
					{
						sf_num[2 * int(nScales) * i + j * 2 + 0] = multiply(ysf[j ], ( sf[2 * int(nScales) * i + j * 2 + 0] >>0), 8);//1024 X轴
						sf_num[2 * int(nScales) * i + j * 2 + 1] = multiply(ysf[j ], (-sf[2 * int(nScales) * i + j * 2 + 1] >>0), 8);//1024 Y轴
					}
				}
			{
					int xsinput[17 * 17] = { 0 };
					int k = 0;
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
							for (j = 0; j < 144; j = j + 1)
								xsinput[i * 17 + k]+=(xs[17 * j + k] * scale_basis_den[17 * j + i]) >> 5;//1024*32
					}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
							xsinput[i * 17 + k] = xsinput[i * 17 + k] >> 5;//1024
					}
					for (i = 0; i < 17; i++)
					{
						for (k = 0; k < 17; k++)
						{
							xsinput[i * 17 + k] = (xsinput[i * 17 + k] * scale_window[k])>>10;//17*17的降维后的特征矩阵和一个一维的汉明窗进行相乘
						}
						fft(xsinput + i * 17, xsf + i * 2 * 17, 17);//1024*1024
				}
				}
			////3-2-5 训练后的17维尺度特征
				for(i=0;i<nScales;i++)
				{
					k=0;
					for(j=0;j<nScales;j++)
						k += multiply(xsf[2* int(nScales) *j+i*2+0]>>5,xsf[2* int(nScales) *j+i*2+0]>>5,10) + multiply(xsf[2* int(nScales) *j+i*2+1]>>5,xsf[2* int(nScales) *j+i*2+1]>>5,10);
					new_sf_den[i] = k>>9;
				}//1
			//updata   更新特征因子 
			if (frame == 1)
			{
				for (i = 0; i<(2 * SIZE * 2 * SIZE) / 16; i++) hf_den[i] = new_hf_den[i];
				//		for(i=0;i<int(nScales);i++) sf_den[i]=new_sf_den[i];

				// for(i=0;i<2*(2*SIZE*2*SIZE)/16;i++) hf_num[i]=new_hf_num[i];
				// for(i=0;i<2*144*32;i++) sf_num[i]=new_sf_num[i];
			}
			else if (frame > 1)
			{
				for (i = 0; i<(2 * SIZE * 2 * SIZE) / 16; i++) hf_den[i] -= (hf_den[i] - new_hf_den[i])*0.025;//0.025
																											  //	for (i = 0; i<int(nScales); i++) sf_den[i] -= (sf_den[i] - new_sf_den[i]) * 0.025;

																											  // for(i=0;i<2*(2*SIZE*2*SIZE)/16;i++) hf_num[i]-=(hf_num[i]-new_hf_num[i])>>3;
																											  // for(i=0;i<2*144*32;i++) sf_num[i]-=(sf_num[i]-new_sf_num[i])>>3;
			}
		}

		if ((lastmaxconfidences<VAR_CON) && (maxconfidences<VAR_CON))
			lasting_lostframes++;
		else
			lasting_lostframes = 0;

		lastmaxconfidences = maxconfidences;
		//std::cout << "base_target_sz[0]:" << base_target_sz[0] << std::endl;
		//std::cout << "currentScaleFactor[0]:" << currentScaleFactor << std::endl;
		target_sz[0] = floor(base_target_sz[0] * currentScaleFactor);
		target_sz[1] = floor(base_target_sz[1] * currentScaleFactor);
		targetsize[0] = target_sz[0];
		targetsize[1] = target_sz[1];
		targetpos[0] = pos[0];
		targetpos[1] = pos[1];
	}

	targetsize[0] = target_sz[0];
	targetsize[1] = target_sz[1];
	targetpos[0] = pos[0];
	targetpos[1] = pos[1];

	if (*trackflag == 2) //搜跟状态
	{
		trackstatus[0] = 0;//
		trackstatus[1] = 0;
		trackstatus[2] = 0;
		trackstatus[3] = 64;//targetsize[0];
		trackstatus[4] = 64;//targetsize[1];
	}
	else if ((*trackflag == 0) && (lasting_lostframes < 6)) //凝视
	{
		trackstatus[0] = 1;
		trackstatus[1] = h / 2 - targetpos[0];
		trackstatus[2] = targetpos[1] - w / 2;
		trackstatus[3] = targetsize[0];
		trackstatus[4] = targetsize[1];
	}
	else if ((*trackflag == 0) && (lasting_lostframes >= 6))
	{
		trackstatus[0] = 2;//
		trackstatus[1] = 0;
		trackstatus[2] = 0;
		trackstatus[3] = targetsize[0];
		trackstatus[4] = targetsize[1];
	}
}
int forconfidence(int * input, int x, int y, int w, int h, int maxv)
{
	volatile int psr = 0;
	int i, j;
	int sum = 0, mean = 0, var = 0, std = 0;
	int dx, dy;
	dx = x; dy = y;
	if (dx<5) dx = 5;
	if (dx>w - 7) dx = w - 6;
	if (dy<5) dy = 5;
	if (dy>h - 7) dy = h - 6;
	for (j = 0; j<h; j++)
	{
		for (i = 0; i<w; i++)
		{
			sum += input[j*w + i] >> 16;
		}
	}
	for (j = dy - 5; j <= dy + 5; j++)
	{
		for (i = dx - 5; i <= dx + 5; i++)
		{
			sum -= input[j*w + i] >> 16;
		}
	}
	mean = sum / (h*w - 121);
	for (j = 0; j<h; j++)
	{
		for (i = 0; i<w; i++)
		{
			var += abs(((input[j*w + i] >> 16) - mean));//*((input[j*w+i]>>16)-mean));
		}
	}
	for (j = dy - 5; j <= dy + 5; j++)
	{
		for (i = dx - 5; i <= dx + 5; i++)
		{
			var -= abs(((input[j*w + i] >> 16) - mean));//*((input[j*w+i]>>16)-mean));
														//	var+=mean*mean;
		}
	}
	std = var / (w*h - 121);//(fastIntSqrt(var/(w*h-121)));
	if (std == 0)
		std = 1;
	psr = ((maxv >> 16) - mean) / std;
	return psr;


}
//整数相乘 --- 
int multiply(int ix, int iy, int n)
{
	int signx, signy, sign;
	int  nx, ny, product;
	signx = ix & 0x80000000, signy = iy & 0x80000000, sign = signx^signy;
	nx = signx ? (-(ix + 1)) : ix, ny = signy ? (-(iy + 1)) : iy;
	product = (((unsigned int)_smpyh(nx, ny)) << n) + ((((unsigned int)_mpyhlu(nx, ny)) + ((unsigned int)_mpylhu(nx, ny))) >> (15 - n)) + (((unsigned int)(_mpyu(nx, ny))) >> (31 - n));
	product = sign ? (-product - 0) : product + 0;
	return product;

}

int MPYHIRC(int src1, int src2)
{
	long long temp1, temp2;
	temp1 = src1 >> 16;
	temp2 = (temp1 * src2 + 0x4000) >> 15;
	return (temp2 & 0x00000000ffffffff);
}
int MPYLUHS(int src1, int src2)
{
	int temp1, temp2;
	temp1 = src1 & 0x0000ffff;
	temp2 = src2 >> 16;
	return (temp1*temp2);
}
int _smpyh(int src1, int src2)
{
	int temp1, temp2;
	temp1 = src1 >> 16;
	temp2 = src2 >> 16;
	return ((temp1 * temp2) << 1);
}
int _mpyhlu(int src1, int src2)
{
	int temp1, temp2;
	temp1 = src1 >> 16;
	temp2 = src2 & 0x0000ffff;
	return ((temp1 * temp2));
}
int _mpylhu(int src1, int src2)
{
	int temp1, temp2;
	temp1 = src1 & 0x0000ffff;
	temp2 = src2 >> 16;
	return ((temp1 * temp2));
}
int _mpyu(int src1, int src2)
{
	int temp1, temp2;
	temp1 = src1 & 0x0000ffff;
	temp2 = src2 & 0x0000ffff;
	return ((temp1 * temp2));
}

float mmax(float x, float y)
{
	return (x>y ? x : y);
}

float mmin(float x, float y)
{
	return (x<y ? x : y);
}
//汉宁窗--- 弱化边缘特征，突出中心特征
void Hann(int size, int * hannline)
{
	int i;
	for (i = 0; i<size; i++)
		hannline[i] = (0.5*(1 - cos((2 * 3.1415*i) / (size - 1)))) * 1024;
}
//
void get_translation_sample(int w, int h, unsigned char * imgd, volatile float pos[], volatile int sz[],
	float ScaleFactor, unsigned short*cosw, int * out)//input cos_window output
{
	float patch_sz[2];
	int i, j;
	int sum = 0;
	int left = 0, right = w - 1, up = 0, down = h - 1;
	patch_sz[0] = floor(sz[0] * ScaleFactor);
	patch_sz[1] = floor(sz[1] * ScaleFactor);
	patch_sz[0] = patch_sz[0]<1 ? 2 : patch_sz[0];
	patch_sz[1] = patch_sz[1]<1 ? 2 : patch_sz[1];
	left = floor(pos[1] + 1 - floor(patch_sz[1] / 2)) - 0;
	right = floor(pos[1] + patch_sz[1] - floor(patch_sz[1] / 2)) - 0;
	up = floor(pos[0] + 1 - floor(patch_sz[0] / 2)) - 0;
	down = floor(pos[0] + patch_sz[0] - floor(patch_sz[0] / 2)) - 0;
	left = left<0 ? 0 : left;
	right = right >= w - 1 ? w - 1 : right;
	up = up<0 ? 0 : up;
	down = down >= h - 1 ? h - 1 : down;
	for (j = 0; j < down - up + 1; j++)
	{
		for (i = 0; i < right - left + 1; i++)
		{
			im_patch[j * (right - left + 1) + i] = imgd[(j + up) * w + i + left]; //获取目标图像块
		}
	}
	//图像块归一化为 H = 2*SIZE = 64, W =64 的尺寸，输出为tempimg
	//std::cout << "im_patch" << im_patch << std::endl;
	alignedimg(im_patch, right - left + 1, down - up + 1, tempimg, 2 * SIZE, 2 * SIZE);
	//4*4个像素点组成一个block ---- 和余弦窗卷积--- 计算灰度值响应
	for (j = 0; j < 2 * SIZE; j = j + 4)
	{
		for (i = 0; i < 2 * SIZE; i = i + 4)
		{
			out[sum] = ((tempimg[j * 2 * SIZE + i] + tempimg[j * 2 * SIZE + i + 1] + tempimg[j * 2 * SIZE + i + 2] + tempimg[j * 2 * SIZE + i + 3] +
				tempimg[(j + 1) * 2 * SIZE + i] + tempimg[(j + 1) * 2 * SIZE + i + 1] + tempimg[(j + 1) * 2 * SIZE + i + 2] + tempimg[(j + 1) * 2 * SIZE + i + 3] +
				tempimg[(j + 2) * 2 * SIZE + i] + tempimg[(j + 2) * 2 * SIZE + i + 1] + tempimg[(j + 2) * 2 * SIZE + i + 2] + tempimg[(j + 2) * 2 * SIZE + i + 3] +
				tempimg[(j + 3) * 2 * SIZE + i] + tempimg[(j + 3) * 2 * SIZE + i + 1] + tempimg[(j + 3) * 2 * SIZE + i + 2] + tempimg[(j + 3) * 2 * SIZE + i + 3]) >> 0) * cosw[sum];
			sum++;
		}////////////////test
	}
	/*		for(i=0;i<16;i++) for(j=0;j<16;j++) out[(15-i)*16+15-j]=0;
	for(i=0;i<16;i++)
	for(j=newimgflag;j<16;j++)
	out[(15-i)*16+15-j+newimgflag]=((2*floor(((i+11)*(i+1))/3.+((j+1)*(j+1))/4.))>255?255:(2*floor(((i+11)*(i+1))/3.+((j+1)*(j+1))/4.)));
	for(i=0;i<16*16;i++)out[i]=(out[i]*cosw[i])>>0;
	*/
}

//获取梯度尺度因子
void get_scale_sample(int w, int h, unsigned char * imgd, volatile float pos[], float base_target_sz[],
	float currentScaleFactor, float scaleSizeFactors[], int scalew[], float scale_model_sz[], int *xs)
{
	float patch_sz[2];
	int out_pca[144];
	int i, j, m = 0, k = 0;

	int binSize = 4;
	int nOrients = 9;
	int softBin = 0;

	int hb, wb, nb, nChns;
	int left = 0, right = w - 1, up = 0, down = h - 1;
	for (m = 0; m<nScales; m++)
	{
		patch_sz[0] = floor(base_target_sz[0] * currentScaleFactor*scaleSizeFactors[m]);
		patch_sz[1] = floor(base_target_sz[1] * currentScaleFactor*scaleSizeFactors[m]);
		
		left = 0, right = w - 1, up = 0, down = h - 1;
		left = floor(pos[1] + 1 - floor(patch_sz[1] / 2));
		right = floor(pos[1] + patch_sz[1] - floor(patch_sz[1] / 2));
		up = floor(pos[0] + 1 - floor(patch_sz[0] / 2));
		down = floor(pos[0] + patch_sz[0] - floor(patch_sz[0] / 2));
		left = left<0 ? 0 : left;
		right = right >= w - 1 ? w - 1 : right;
		up = up<0 ? 0 : up;
		down = down >= h - 1 ? h - 1 : down;
		for (j = 0; j<down - up + 1; j++)
		{
			for (i = 0; i<right - left + 1; i++)
			{
				im_patch[j*(right - left + 1) + i] = imgd[(j + up)*w + i + left];
			}
		}
		alignedimg(im_patch, right - left + 1, down - up + 1, tempimg, scale_model_sz[0], scale_model_sz[1]);
		//test img	
		for (i = 0; i<scale_model_sz[0] * scale_model_sz[1]; i++) imgscaletemp[i] = tempimg[i];
		binSize = 4; nOrients = 9; softBin = 0; 
		hb = scale_model_sz[0] / binSize; wb = scale_model_sz[1] / binSize; nb = hb*wb; nChns = nOrients * 1 + 0;
		for (i = 0; i<SIZE*SIZE / 4; i++) { M[i] = 0; O[i] = 0; }
		for (i = 0; i<hb*wb*nChns; i++) out_pca[i] = 0;
		gradientMagnitude(imgscaletemp, M, O, (int)(scale_model_sz[0]), (int)(scale_model_sz[1]), 1, 1);//M512 O 16384
																										/* {
																										float Mfloat[256] = { 7.6152, 8.9453, 9.4336,10.0000,12.8066,11.7168, 8.1406, 5.0000, 3.6064, 3.9058, 2.0615, 6.7080, 9.0156, 7.0723,10.6309,12.2070
																										, 8.2461, 9.1934, 9.8633, 9.8633,12.1074,13.7949,11.6758, 7.8115, 4.2432, 3.5361, 3.0415, 7.9053, 7.9053, 2.2363, 6.4033,11.9258
																										, 8.7324, 8.2773, 9.4336, 9.0156, 9.5547,12.0449,14.1582,12.3809, 8.1406, 4.3018, 5.1484, 8.7480, 6.7275, 2.9160, 0.5001, 6.4033
																										,16.0117, 7.6328, 7.4316, 8.1406, 8.0645, 7.8262, 9.1797,11.8027,10.0000, 6.4033, 5.2207, 6.9648, 4.5000, 2.5498, 1.5811, 2.8291
																										,31.2461,17.4180, 8.4863, 6.9648, 8.6328, 8.6328, 7.1592, 7.7627, 7.7627, 3.5361, 0.0000, 2.6924, 4.9258, 4.6104, 2.2363, 3.5000
																										,31.7734,22.5625,13.7305,10.5117, 8.0176, 7.2803, 8.0801, 9.0566, 9.8242, 7.8115, 5.5010, 4.9258, 5.0996, 4.5000, 4.5283, 5.5908
																										,36.8984,28.6875,16.6211, 8.6328, 6.5000, 7.5000,10.5957,13.0410,11.7715, 7.9053, 4.5283, 4.2432, 3.2017, 2.5498, 4.0322, 4.9258
																										,48.0000,32.2109,17.4648, 4.2725, 3.6064, 7.2129,13.7598,15.2949,13.3457, 8.0020, 1.8032, 4.1230, 1.8032, 1.8032, 2.9160, 3.1621
																										,37.6484,18.0078,18.1211,11.5039, 5.0254, 7.1064,13.0410,17.6133,17.0703,12.0938, 2.0615, 3.0415, 2.1216, 1.4146, 1.5811, 1.1182
																										,20.1563,14.7773,22.0938,17.5313, 8.7324, 9.8516,12.0234,17.6953,20.5273,17.7578, 6.1035, 0.7073, 1.8032, 1.5000, 1.1182, 1.1182
																										,14.7031,17.0117,23.0078,21.5273, 8.5020, 7.2129,10.9648,15.2383,21.1016,21.7852,11.6309, 2.0005, 1.1182, 1.5000, 1.5811, 1.4146
																										,16.0352,18.0078,23.5547,21.5977, 8.7324, 6.0225, 9.6191,12.4199,19.3008,25.4961,18.1250, 6.0420, 1.1182, 1.5811, 1.5811, 1.0002
																										,15.0078,18.3438,25.6250,23.0898,14.9180,15.6973,15.6602,13.9004,17.9023,25.0469,22.8320,11.8535, 3.5361, 1.1182, 0.5001, 0.0000
																										,21.6328,25.1055,30.8047,29.0039,24.3945,21.1016,21.4766,19.9180,21.9219,25.0664,25.2969,18.3594, 7.6152, 1.8032, 0.7073, 1.1182
																										,27.2773,28.9023,31.5625,27.7266,20.1797,12.8184,15.6973,18.4023,23.1133,28.4023,25.9375,22.3633,12.5430, 3.6064, 1.5811, 1.0002
																										,25.6367,25.2383,25.8672,20.4063,13.4648, 6.4033, 9.6055,13.8281,19.2969,27.2773,27.2773,24.6992,16.1602, 5.3848, 2.0615, 2.0005 },
																										Ofloat[256] = { 5.1172, 5.1759, 5.2709, 5.3558, 5.3870, 5.4069, 5.4540, 5.6395, 5.6947, 5.4070, 4.4676, 3.6057, 3.4818, 2.9979, 2.4225, 2.5305,
																										4.9572, 5.1028, 5.2440,5.2440,5.3804,5.4719,5.5278,5.5883,5.4975,5.4975,4.5473,3.7475,3.7475,3.6057,2.4666,2.5650,
																										4.9434,5.1489,5.2709,5.3002,5.4604,5.5562,5.5475,5.5260,5.4540,5.3325,4.2055,3.6826,3.8747,5.2526,3.1171,2.4666,
																										4.9649,5.2639,5.4501,5.5409,5.7635,5.8190,5.7704,5.6477,5.6395,5.3870,4.4211,3.5095,3.1171,0.1988,5.9605,2.3559,
																										5.4070,5.5991,5.4975,5.9153,6.1069,6.1069,6.0716,6.0221,6.0221,6.1395,1.5708,2.7606,1.9889,1.3523,1.1073,1.5708,
																										5.9466,6.0591,6.0996,0.0510,6.2168,6.0041,5.9019,0.1123,0.2584,0.6949,1.5708,1.9889,1.7681,1.5708,1.4602,1.3910,
																										0.5735,0.7239,0.8070,0.1763,5.8877,5.6394,5.9460,0.0813,0.2158,0.6059,1.6814,2.3559,2.2454,1.3735,1.0518,1.1527,
																										0.9483,1.1212,1.8018,2.7822,5.3002,5.6947,5.9494,6.0854,6.0551,0.0245,2.5531,2.8956,2.5531,0.9830,0.5410,0.3226,
																										1.2744,1.5985,2.6528,3.1133,4.8120,5.3978,5.7160,5.6791,5.7272,5.7635,4.9572,2.9753,2.3559,0.7857,0.3226,5.8190,
																										1.9788,2.7226,3.0499,3.2032,4.3001,5.1305,5.4975,5.5375,5.6881,5.7182,5.6721,2.3559,2.1586,1.5708,0.4642,0.4642,
																										2.8302,3.1042,3.1133,3.1926,3.6321,5.3002,5.5298,5.5673,5.6489,5.7267,5.8382,0.0245,2.0343,1.5708,1.2492,0.7857,
																										3.2079,3.1762,3.2094,3.2365,3.3736,4.7955,5.1992,5.4121,5.6445,5.7931,5.8559,5.8562,1.1073,1.2492,1.2492,1.5708,
																										3.6652,3.4467,3.4393,3.4507,3.8323,4.5525,5.0037,5.3702,5.6560,5.8283,5.7799,5.8002,6.1395,1.1073,1.5708,1.5708,
																										4.1245,3.9130,3.7660,3.7679,3.9416,4.4732,5.1446,5.3909,5.4976,5.7832,5.7664,5.7704,5.8779,5.6947,3.9273,3.6057,
																										4.2569,4.0621,3.8485,3.8252,3.8747,4.3538,5.3622,5.4592,5.6050,5.8271,5.8021,5.8193,5.8724,5.6947,5.0340,4.7124,
																										4.3538,4.1246,3.8586,3.7708,3.6888,4.0378,5.6082,5.5743,5.7379,5.8278,5.8278,5.9095,5.9019,5.9022,4.9572,4.7124 }; float out_pcafloat[256] = { 0 };
																										for (i = 0; i < SIZE * SIZE / 4; i++) { M[i]= Mfloat[i]*512 ; O[i] = Ofloat[i]*16384; }
																										//	gradHistfloat(Mfloat, Ofloat, out_pcafloat, (int)(scale_model_sz[0]), (int)(scale_model_sz[1]), binSize, nOrients, softBin, 0);//4096

																										}*/
		for (i = 0; i < SIZE * SIZE / 4; i++) { O[i] = O[i] >> 3; }//2048
		gradientHist(M, O, out_pca, (int)(scale_model_sz[0]), (int)(scale_model_sz[1]), binSize, nOrients, softBin, 0);//4096
		for (k = 0; k<nChns; k++)
			for (j = 0; j<hb; j++)
				for (i = 0; i<wb; i++)
					xs[/*hb*wb*nChns*/(int(nScales)) *(k*nb + i*wb + j) + m] = ((out_pca[k*nb + j*wb + i]/**scalew[m]*/) >> 2);//1024
	}
}

//图像尺寸归一化
void alignedimg(unsigned char* src, int Width, int Hight, unsigned char* dst, int w, int h)
{
	int j, i;
	int x, y, px1, px2, py1, py2;
	int p1, p2, p3, p4, sx, sy, temp1, temp2, temp3, temp4;
	int ww, hh;
	ww = w * 1024;
	hh = h * 1024;
	/*	for(j=0;j<hh;j=j+1024)//w=128 h=128
	for(i=0;i<ww;i=i+1024)
	{
	x=((i*Width)/w);
	y=((j*Hight)/h);
	sx=(x&0xFFFFFC00);
	sy=(y&0xFFFFFC00);
	px1=x-sx;
	py1=y-sy;
	px2=1024-px1;
	py2=1024-py1;
	p1=(sy>>10)*Width+(sx>>10);
	p2=p1+1;
	p3=p1+Width;
	p4=p1+Width+1;
	dst[(j>>10)*w+(i>>10)]=((py2*((px1*src[p2]+px2*src[p1]))+py1*((px1*src[p4]+px2*src[p3])))>>20);
	}*/
	if (w == 64 && h == 64)
	{
		for (j = 0; j < hh; j = j + 1024)//w=64 h=64
		{
			for (i = 0; i<ww; i = i + 1024)
			{
				x = ((i*Width) >> 6);
				y = ((j*Hight) >> 6);
				sx = (x & 0xFFFFFC00);
				sy = (y & 0xFFFFFC00);
				px1 = x - sx;
				py1 = y - sy;
				px2 = 1024 - px1;
				py2 = 1024 - py1;
				p1 = (sy >> 10)*Width + (sx >> 10);
				temp2 = py2*px2*src[p1];
				p2 = p1 + 1;
				temp1 = py2*px1*src[p2];
				p3 = p1 + Width;
				temp4 = py1*px2*src[p3];
				p4 = p1 + Width + 1;
				temp3 = py1*px1*src[p4];
				dst[(j >> 10)*w + (i >> 10)] = ((temp1 + temp2 + temp3 + temp4) >> 20);
			}
		}

	}
	else if (w == 16 && h == 16)
	{
		for (j = 0; j < hh; j = j + 1024)//w=16 h=16
		{
			for (i = 0; i < ww; i = i + 1024)
			{
				x = ((i * Width) >> 4);
				y = ((j * Hight) >> 4);
				sx = (x & 0xFFFFFC00);
				sy = (y & 0xFFFFFC00);
				px1 = x - sx;
				py1 = y - sy;
				px2 = 1024 - px1;
				py2 = 1024 - py1;
				p1 = (sy >> 10) * Width + (sx >> 10);
				temp2 = py2 * px2 * src[p1];
				p2 = p1 + 1;
				temp1 = py2 * px1 * src[p2];
				p3 = p1 + Width;
				temp4 = py1 * px2 * src[p3];
				p4 = p1 + Width + 1;
				temp3 = py1 * px1 * src[p4];
				dst[(j >> 10) * w + (i >> 10)] = ((temp1 + temp2 + temp3 + temp4) >> 20);
			}
		}
	}
	else
	{
		for (j = 0; j < hh; j = j + 1024)//w=128 h=128
		{
			for (i = 0; i < ww; i = i + 1024)
			{
				x = ((i * Width) / w);
				y = ((j * Hight) / h);
				sx = (x & 0xFFFFFC00);
				sy = (y & 0xFFFFFC00);
				px1 = x - sx;
				py1 = y - sy;
				px2 = 1024 - px1;
				py2 = 1024 - py1;
				p1 = (sy >> 10) * Width + (sx >> 10);
				p2 = p1 + 1;
				p3 = p1 + Width;
				p4 = p1 + Width + 1;
				dst[(j >> 10) * w + (i >> 10)] = ((py2 * ((px1 * src[p2] + px2 * src[p1])) + py1 * ((px1 * src[p4] + px2 * src[p3]))) >> 20);
			}
		}
	}
}

//梯度求解
// compute x and y gradients for just one column
void grad1(int *I, int *Gx, int *Gy, int h, int w, int x)
{
	int y; int *Ip, *In; int r;
	// compute column of Gx
	Ip = I - h; In = I + h; r = 05;
	if (x == 0) { r = 1; Ip += h; }
	else if (x == w - 1) { r = 1; In -= h; }
	if (r == 1)
	{
		if (h<4 || h % 4>0 || (((int)(*I)) & 15) || (((int)(*Gx)) & 15))
		{
			for (y = 0; y<h; y++) *Gx++ = ((*In++ - *Ip++) << 1);
		}
		else
		{
			for (y = 0; y<h; y++) Gx[y] = ((In[y] - Ip[y]) << 1);
		}
	}
	if (r == 05)
	{
		if (h<4 || h % 4>0 || (((int)(*I)) & 15) || (((int)(*Gx)) & 15))
		{
			for (y = 0; y<h; y++) *Gx++ = ((*In++ - *Ip++) >> 0);
		}
		else
		{
			for (y = 0; y<h; y++) Gx[y] = ((In[y] - Ip[y]) >> 0);
		}
	}
	// compute column of Gy b
	//  #define GRADY(r) *Gy++=(*In++-*Ip++)*r;
	Ip = I; In = Ip + 1;
	//  y1=((~((int) Gy) + 1) & 15)/4; if(y1==0) y1=4; if(y1>h-1) y1=h-1;

	// y1=h-1;
	*Gy++ = ((*In++ - *Ip++) << 1); Ip--; for (y = 1; y<h - 1; y++) *Gy++ = ((*In++ - *Ip++) >> 0);
	In--; *Gy++ = ((*In++ - *Ip++) << 1);
	//#undef GRADY
}

// build lookup table a[] s.t. a[x*n]~=acos(x) for x in [-1,1]
/*float* acosTable() {
const int n=10000, b=10; int i;
//  static float a[20020];
static int init=0;
float *a1=a+n+b; if( init==1 ) return a1;
for( i=-n-b; i<-n; i++ )   a1[i]=PI;
for( i=-n; i<n; i++ )      a1[i]=(float)(acos(i/(1.0*n)));
for( i=n; i<n+b; i++ )     a1[i]=0;
for( i=-n-b; i<n/10; i++ ) if( a1[i] > PI-1e-6f ) a1[i]=PI-1e-6f;
init=1; return a1;
}
*/

void gradientMagnitude(int  *I, int *M, int *O, int h, int w, int d, int full)
{
	int x, y, y1, c, h4, s; int *Gx, *Gy, *M2; float * fGx, *fGy;
	unsigned short *acost = acostable;
	// allocate memory for storing one column of output (padded so h4%4==0)
	h4 = (h % 4 == 0) ? h : h - (h % 4) + 4; s = d*h4*sizeof(int);

	M2 = (int *)malloc(sizeof(int)*d*h4);
	Gx = (int*)malloc(sizeof(int)*d*h4);
	Gy = (int*)malloc(sizeof(int)*d*h4);
	memset(M2, 0, s);
	memset(Gx, 0, s);
	memset(Gy, 0, s);
	fGx = (float*)malloc(sizeof(float)*d*h4);
	fGy = (float*)malloc(sizeof(float)*d*h4);
	memset(fGx, 0, s);
	memset(fGy, 0, s);

	// compute gradient magnitude and orientation for each column
	for (x = 0; x<w; x++)
	{
		// compute gradients (Gx, Gy) with maximum squared magnitude (M2)
		for (c = 0; c<d; c++)
		{
			grad1(I + x*h + c*w*h, Gx + c*h4, Gy + c*h4, h, w, x);
			for (y = 0; y<h4; y++)
			{
				y1 = h4*c + y;
				M2[y1] = ((Gx[y1] * Gx[y1] + Gy[y1] * Gy[y1]));

				/*        if( c==0 ) continue;
				M2[y] = M2[y1] > M2[y] ? M2[y1] : M2[y];
				Gx[y] = M2[y1] > M2[y] ? Gx[y1] : Gx[y];
				Gy[y] = M2[y1] > M2[y] ? Gy[y1] : Gy[y];*/
			}
		}
		// compute gradient mangitude (M) and normalize Gx
		for (y = 0; y<h4; y++)
		{
			/*	   float m =  1.0f/sqrt((float)M2[y]);
			m = m < 1e10f ? m : 1e10f;
			M2[y] = 1.0f/m;
			*/		 float m;
		M2[y] = M2[y] == 0 ? 0 : ((fastIntSqrt(M2[y] * 256 * 16)) << 2);//512*32=128*128  16
		m = M2[y] == 0 ? 10000000 : 5120000. / M2[y];

		fGx[y] = Gx[y] * 0.5; fGy[y] = Gy[y] * 0.5;
		if (O) fGx[y] = (fGx[y] * m);

		if (O)
		{
			//bitwise AND on floats
			int i;
			float zero = -0.f;
			unsigned char *pGy = 0;
			unsigned char *pZero = 0;
			unsigned char *pGand = 0;
			float Gand = 0.f;
			pGy = (unsigned char *)(&fGy[y]);
			pZero = (unsigned char *)(&zero);
			pGand = (unsigned char *)(&Gand);
			for (i = 0; i<4; i++)
			{
				*pGand = (*pGy & *pZero);
				pGand++;
				pGy++;
				pZero++;
			}

			//bitwise XOR on floats
			unsigned char *pGx = 0;
			unsigned char *pGxor = 0;
			float Gxor = 0;
			pGx = (unsigned char *)(&fGx[y]);
			pGand = (unsigned char *)(&Gand);
			pGxor = (unsigned char *)(&Gxor);
			for (i = 0; i<04; i++)
			{
				*pGxor = (*pGx ^ *pGand);
				pGxor++;
				pGx++;
				pGand++;
			}
			fGx[y] = Gxor;
		}
		}

		memcpy(M + x*h, M2, h*sizeof(int));
		// compute and store gradient orientation (O) via table lookup
		if (O != 0) for (y = 0; y<h; y++)
			O[x*h + y] = 25736 - acost[(int)fGx[y] + 10010];
		if (O != 0 && full)
		{
			for (y = 0; y<h; y++) O[y + x*h] = ((int)fGx[y]>-10000) && (fGy[y]<0.0001) ? (51472 - O[y + x*h]) : O[y + x*h];
		}
		if (O != 0) for (y = 0; y < h; y++)
			O[x * h + y] = O[x * h + y] < 0 ? 102944 + O[x * h + y] : O[x * h + y] >25736 ? 102944 - O[x * h + y] : O[x * h + y];

	}

	free(M2);
	free(Gx);
	free(Gy);
	free(fGx);
	free(fGy);
}

// helper for gradHist, quantize O and M into O0, O1 and M0, M1
void gradQuantize(int *O, int *M, int *O0, int *O1, int *M0, int *M1,
	int nb, int n, float norm, int nOrients, int full, int interpolate)
{
	// assumes all *OUTPUT* matrices are 4-byte aligned
	int i, o0, o1; //float o, od, m;
	int o, od, m;
	//	const float oMult=(float)nOrients/(full?2*PI:PI);
	const int oMax = (nOrients*(nb << 11));
	const int oMult = (int)(9 * 8 * 512. / PI);
	if (interpolate)
	{
		for (i = 0; i <= n - 1; i++) {//mark
			o = (O[i] * oMult) >> 12; o0 = ((o >> 11) << 11); od = o - o0;//od 409616384
			o0 *= nb; o0 = (oMax > o0) ? o0 : 0; O0[i] = o0;//O0 409616384
			o1 = o0 + (nb << 11); o1 = (oMax != o1) ? o1 : 0; O1[i] = o1;//O1 409616384
			/*m=M[i]*norm*32;*/m = (M[i] << 1);
			M1[i] = (od * m) >> 13; M0[i] = (m >> 2) - M1[i];// 4096
		}

		// compute trailing locations without sse
		/*	for( i; i<n; i++ ) {
		o=O[i]*oMult; o0=(int) o; od=o-o0;
		o0*=nb; if(o0>=oMax) o0=0; O0[i]=o0;
		o1=o0+nb; if(o1==oMax) o1=0; O1[i]=o1;
		m=M[i]*norm; M1[i]=od*m; M0[i]=m-M1[i];
		}*/
	}

}

// compute nOrients gradient histograms per bin x bin block of pixels
void gradientHist(int *M, int *O, int *H, int h, int w, int bin, int nOrients, int softBin, int full)
{
	const int hb = h / bin, wb = w / bin, h0 = hb*bin, w0 = wb*bin, nb = wb*hb;
	const float s = (float)bin,  sInv2 = 1 / s / s;
	int  *H1, *M0, *M1; int x, y; int *O0, *O1; 

	O0 = (int*)malloc(sizeof(int)*h);
	M0 = (int*)malloc(sizeof(int)*h);
	O1 = (int*)malloc(sizeof(int)*h);
	M1 = (int*)malloc(sizeof(int)*h);

	// main loop
	for (x = 0; x<w0; x++) {
		// compute target orientation bins for entire column - very fast
		gradQuantize(O + x*h, M + x*h, O0, O1, M0, M1, nb, h0, sInv2, nOrients, full, 1);

		if (softBin % 2 == 0) {
			// interpolate w.r.t. orientation only, not spatial bin
			H1 = H + (x / bin)*hb;
#define GH H1[(O0[y])>>11]+=(M0[y]>>0); H1[(O1[y])>>11]+=(M1[y]>>0); y++;
			if (bin == 4) for (y = 0; y<h0;) { GH; GH; GH; GH; H1++; }
#undef GH
		}

	}

	free(O0);
	free(M0);
	free(O1);
	free(M1);
}
//void gradQuantizefloat(float* O, float* M, int* O0, int* O1, float* M0, float* M1,
//	int nb, int n, float norm, int nOrients, bool full, bool interpolate)
//{
//	// assumes all *OUTPUT* matrices are 4-byte aligned
//	int i, o0, o1; float o, od, m;
//	__m128i _o0, _o1, * _O0, * _O1; __m128 _o, _od, _m, * _M0, * _M1;
//	// define useful constants
//	const float oMult = (float)nOrients / (full ? 2 * PI : PI); const int oMax = nOrients * nb;
//	//const __m128 _norm = SET(norm), _oMult = SET(oMult), _nbf = SET((float)nb);
//	//const __m128i _oMax = SET(oMax), _nb = SET(nb);
//	//// perform the majority of the work with sse
//	//_O0 = (__m128i*) O0; _O1 = (__m128i*) O1; _M0 = (__m128*) M0; _M1 = (__m128*) M1;
//	//if (interpolate)
//	//for (i = 0; i <= n - 4; i += 4) {
//	//	_o = MUL(LDu(O[i]), _oMult); _o0 = CVT(_o); _od = SUB(_o, CVT(_o0));
//	//	_o0 = CVT(MUL(CVT(_o0), _nbf)); _o0 = AND(CMPGT(_oMax, _o0), _o0); *_O0++ = _o0;
//	//	_o1 = ADD(_o0, _nb); _o1 = AND(CMPGT(_oMax, _o1), _o1); *_O1++ = _o1;
//	//	_m = MUL(LDu(M[i]), _norm); *_M1 = MUL(_od, _m); *_M0++ = SUB(_m, *_M1); _M1++;
//	//}
//	
//	// compute trailing locations without sse
//	if (interpolate) 
//		for (i=0; i < n; i++) {
//		o = O[i] * oMult; o0 = (int)o; od = o - o0;
//		o0 *= nb; if (o0 >= oMax) o0 = 0; O0[i] = o0;
//		o1 = o0 + nb; if (o1 == oMax) o1 = 0; O1[i] = o1;
//		m = M[i] * norm; M1[i] = od * m; M0[i] = m - M1[i];
//	}
//	
//}
//void gradHistfloat(float* M, float* O, float* H, int h, int w,
//	int bin, int nOrients, int softBin, bool full)
//{
//	const int hb = h / bin, wb = w / bin, h0 = hb * bin, w0 = wb * bin, nb = wb * hb;
//	const float s = (float)bin, sInv = 1 / s, sInv2 = 1 / s / s;
//	float* H0, * H1, * M0, * M1; int x, y; int* O0, * O1;
//	O0 = (int*)calloc(h * sizeof(int), 16); M0 = (float*)calloc(h * sizeof(float), 16);
//	O1 = (int*)calloc(h * sizeof(int), 16); M1 = (float*)calloc(h * sizeof(float), 16);
//	// main loop
//	for (x = 0; x < w0; x++) {
//		// compute target orientation bins for entire column - very fast
//		gradQuantizefloat(O + x * h, M + x * h, O0, O1, M0, M1, nb, h0, sInv2, nOrients, full, softBin >= 0);
//
//		if (softBin % 2 == 0 || bin == 1) {
//			// interpolate w.r.t. orientation only, not spatial bin
//			H1 = H + (x / bin) * hb;
//#define GH H1[O0[y]]+=M0[y]; H1[O1[y]]+=M1[y]; y++;
//			if (bin == 1)      for (y = 0; y < h0;) { GH; H1++; }
//			else if (bin == 2) for (y = 0; y < h0;) { GH; GH; H1++; }
//			else if (bin == 3) for (y = 0; y < h0;) { GH; GH; GH; H1++; }
//			else if (bin == 4) for (y = 0; y < h0;) { GH; GH; GH; GH; H1++; }
//			else for (y = 0; y < h0;) { for (int y1 = 0; y1 < bin; y1++) { GH; } H1++; }
//#undef GH
//
//		}
//	}
//	free(O0); free(O1); free(M0); free(M1);
//	// normalize boundary bins which only get 7/8 of weight of interior bins
//}
void resizeDFT2(int wi, int hi, int * input, int wo, int ho, int * output)
{
	int i, j,  minsz[2], mids[2], mide[2], scaling = 0;
	
	minsz[0] = wi<wo ? wi : wo;
	minsz[1] = (hi<ho ? hi : ho) / 2;
	scaling = (wo*ho / 2) / (wi*hi / 2);
	mids[0] = ceil(minsz[0] / 2);
	mids[1] = ceil(minsz[1] / 2);//8
	mide[0] = floor((minsz[0] - 1) / 2.) - 1;//6
	mide[1] = floor((minsz[1] - 1) / 2.) - 1;
	for (i = 0; i<mids[1]; i++)
		for (j = 0; j<mids[0]; j++)
		{
			output[i*ho + 2 * j] = scaling*input[i*hi + 2 * j];
			output[i*ho + 2 * j + 1] = scaling*input[i*hi + 2 * j + 1];
		}
	for (i = wo - mide[1] - 1; i<wo; i++)
		for (j = 0; j<mids[0]; j++)
		{
			output[i*ho + 2 * j] = scaling*input[(wi + i - wo)*hi + 2 * j];
			output[i*ho + 2 * j + 1] = scaling*input[(wi + i - wo)*hi + 2 * j + 1];
		}
	for (i = 0; i<mids[1]; i++)
		for (j = ho / 2 - mide[0] - 1; j<ho / 2; j++)
		{
			output[i*ho + 2 * j] = scaling*input[i*hi + 2 * (j - ho / 2 + wi)];
			output[i*ho + 2 * j + 1] = scaling*input[i*hi + 2 * (j - ho / 2 + wi) + 1];
		}
	for (i = wo - mide[1] - 1; i<wo; i++)
		for (j = ho / 2 - mide[0] - 1; j<ho / 2; j++)
		{
			output[i*ho + 2 * j] = scaling*input[(wi + i - wo)*hi + 2 * (j - ho / 2 + wi)];
			output[i*ho + 2 * j + 1] = scaling*input[(wi + i - wo)*hi + 2 * (j - ho / 2 + wi) + 1];
		}
}
void resizeDFT(int wi, int* input, int wo, int* output)
{
	int  j, minsz, mids, mide;
	float  scaling = 0;
	
	minsz = wi < wo ? wi : wo;
	scaling = wo*1.0 / wi;
	mids = ceil(minsz / 2.);
	mide = floor((minsz - 1) / 2.) - 1;//6
	for (j = 0; j < mids; j++)
	{
		output[2 * j] = scaling * input[2 * j];
		output[2 * j + 1] = scaling * input[2 * j + 1];
	}
	for (j = wo - mide - 1; j < wo; j++)
	{
		output[2 * j] = scaling * input[2 * (j - wo + wi)];
		output[2 * j + 1] = scaling * input[2 * (j - wo + wi) + 1];
	}

}
void fft(int * input, int * output, int l)//
{
	int i, j;
	memset(output, 0, 2 * l*sizeof(int));
	if (l == 16) DSP_fft32x32(ptr_w_16, 16, input, output);
	else if (l == 32)DSP_fft32x32(ptr_w_32, 32, input, output);
	else if (l == 64)DSP_fft32x32(ptr_w_64, 64, input, output);
	//	else if(l==256)DSP_fft32x32(ptr_w_256, 256, input, output);
	else if ((l % 4) != 0)
	{
		for (i = 0; i < l; i++)
			for (j = 0; j < l; j++)
			{
				output[2 * i] += 1024 * cos(2 * PI * i * j / l) * input[j];
				output[2 * i + 1] += -1024 * sin(2 * PI * i * j / l) * input[j];
			}
	}
}
void ifft(int * input, int * output, int l)//复数 symmetric
{
	int i, j;
	memset(output, 0, 2 * l*sizeof(int));
	if (l == 16) DSP_ifft32x32(ptr_w_16, 16, input, output);
	else if (l == 32)DSP_ifft32x32(ptr_w_32, 32, input, output);
	else if (l == 64)DSP_ifft32x32(ptr_w_64, 64, input, output);
	//	else if(l==256)DSP_ifft32x32(ptr_w_256, 256, input, output);
	else if ((l % 4) != 0)
	{
		for (i = 0; i < l; i++)
			for (j = 0; j < l; j++)
			{
				output[2 * i] += (cos((2 * PI * i * j) / l) * input[2 * j] - input[2 * j + 1] * sin((2 * PI * i * j) / l)) / l;
				output[2 * i + 1] += (sin(2 * PI * i * j / l) * input[2 * j] + cos(2 * PI * i * j / l) * input[2 * j + 1]) / l;
			}

	}
}
void fft2(int * input, int * output, int h, int w)
{
	memset(output, 0, 2 * w*h*sizeof(int));
	if (h == w&&w == 16)
	{
		int x[2 * 16], y[2 * 16];
		int h, i;
		//horizon fft
		for (h = 0; h<16; h++)
		{
			for (i = 0; i<16; i++)
			{
				x[i * 2] = input[i + h * 16] << 0;
				//			x[i*2]=(float)((int)p[i+h*64])/255.0*2147483648/64;
				x[i * 2 + 1] = 0;
			}
			DSP_fft32x32(ptr_w_16, 16, x, output + h * 2 * 16);
		}
		//vertical fft
		for (h = 0; h<16; h++)
		{
			//dma
			for (i = 0; i<2 * 16; i += 2)
			{
				x[i] = output[i * 16 + h * 2] >> 4;
				x[i + 1] = output[i * 16 + h * 2 + 1] >> 4;
			}
			DSP_fft32x32(ptr_w_16, 16, x, y);
			//dma
			for (i = 0; i<2 * 16; i += 2)
			{
				output[i * 16 + h * 2] = y[i];
				output[i * 16 + h * 2 + 1] = y[i + 1];
			}
		}
	}
}
void ifft2(int * input, int * output, int w, int h)
{
	memset(output, 0, w*h*sizeof(int));
	if (w == h&&w == 64)
	{
		int x[2 * 64], y[2 * 64];
		int h, i;
		//horizon ifft
		for (h = 0; h<64; h++)
		{
			DSP_ifft32x32(ptr_w_64, 64, input + h * 2 * 64, y);
			memcpy(input + h * 2 * 64, y, 2 * 64 * sizeof(int));//dma
		}
		//vertical ifft
		for (h = 0; h<64; h++)
		{
			//dma
			for (i = 0; i<2 * 64; i += 2)
			{
				x[i] = input[i * 64 + h * 2];
				x[i + 1] = input[i * 64 + h * 2 + 1];
			}
			DSP_ifft32x32(ptr_w_64, 64, x, y);
			//dma
			for (i = 0; i<2 * 64; i += 2)
			{
				input[i * 64 + h * 2] = y[i];
				input[i * 64 + h * 2 + 1] = y[i + 1];
			}
		}
		for (i = 0; i < 64 * 64; i++)
		{
			//p[i] = (float)frq[i*2]/2147483648 * 255;
			// 		p[i] = frq[i*2]>>(31-8);
			output[i] = input[i * 2];
		}
	}
}

/*void fft64_2D_32x32(int* p, int* frq, const int* w)
{
int x[2*64],y[2*64];
int h,i;
//horizon fft
for ( h=0;h<64;h++)
{
for ( i=0;i<64;i++)
{
x[i*2]=p[i+h*64]<<(31-8-6);
//			x[i*2]=(float)((int)p[i+h*64])/255.0*2147483648/64;
x[i*2+1]=0;
}
DSP_fft32x32(w, 64, x, frq+h*2*64);
}
//vertical fft
for ( h=0;h<64;h++)
{
//dma
for ( i=0;i<2*64;i+=2)
{
x[i] = frq[i*64+h*2]>>6;
x[i + 1] = frq[i*64+h*2+1]>>6;
}
DSP_fft32x32(w, 64, x, y);
//dma
for ( i=0;i<2*64;i+=2)
{
frq[i*64+h*2] = y[i];
frq[i*64+h*2+1] = y[i + 1];
}
}
}

void ifft64_2D_32x32(int* frq, int* p, const int* w)
{
int x[2*64],y[2*64];
int h,i;
//horizon ifft
for ( h=0;h<64;h++)
{
DSP_ifft32x32(w, 64, frq+h*2*64, y);
memcpy(frq+h*2*64,y,2*64*sizeof(int));//dma
}
//vertical ifft
for ( h=0;h<64;h++)
{
//dma
for ( i=0;i<2*64;i+=2)
{
x[i] = frq[i*64+h*2];
x[i + 1] = frq[i*64+h*2+1];
}
DSP_ifft32x32(w, 64, x, y);
//dma
for ( i=0;i<2*64;i+=2)
{
frq[i*64+h*2] = y[i];
frq[i*64+h*2+1] = y[i + 1];
}
}
for ( i = 0; i < 64*64; i++)
{
//p[i] = (float)frq[i*2]/2147483648 * 255;
// 		p[i] = frq[i*2]>>(31-8);
p[i] = frq[i*2];
}
}*/

//施密特正交化 --- QR分解 :  施密特正交化得到的向量组正交,系数矩阵是上三角,满足A=QR。施密特正交化的结果就是矩阵的QR分解结果
void schmidt(int* input, int w, int h, int *output)
{
	/*int i, j, k, l, b, z;
	int m=w>h?w:h, n=w>h?w:h;
	float em, nj;
	float* r = (float*)calloc(m*n,sizeof(float));
	float* a = (float*)calloc(m * n, sizeof(float));
	float* q = (float*)calloc(m * n, sizeof(float));
	for (i = 0; i < m; i++)
	for (j = 0; j < w; j++)
	{
	q[i * m + j] = input[i * w + j]>>5;
	a[i * m + j] = q[i * m + j];

	}
	for (k = 0; k < n; k++)
	{
	for (l = 0; l < k; l++)
	{
	nj = 0;
	for (i = 0; i < m; i++)
	nj = nj + q[i*m+l] * a[i*m+k];
	r[l*m+k] = nj;
	for (i = 0; i < m; i++)
	q[i*m+k] = q[i*m+k] - r[l*m+k] * q[i*m+l];
	}
	em = 0;
	for (i = 0; i < m; i++)
	em = em + q[i*m+l] * q[i*m+l];
	em = sqrt(em);
	r[l*m+k] = em;
	for (i = 0; i < m; i++)
	q[i*m+k] = q[i*m+k] / (r[l*m+k]+0.0000001);
	}
	for (j = 0; j < m; j++)
	for (i = 0; i < w; i++)
	{
	if((i == 0) || (i == 4) || (i == 6) || (i == 7) || (i == 13))output[j * w + i] = -1024*q[j * m + i];
	else output[j * w + i] = 1024*q[j * m + i];
	}
	//	memcpy(output, q, sizeof(int) * m * n);
	free(r);
	free(q);
	free(a);*///float
	int i, j, k, l;
	int m = w > h ? w : h, n = w > h ? w : h;
	int em, nj;
	short tep;
	int* r = (int*)calloc(m * n, sizeof(int));
	short* a = (short*)calloc(m * n, sizeof(short));
	short* q = (short*)calloc(m * n, sizeof(short));
	for (i = 0; i < m; i++)
	{
		for (j = 0; j < w; j++)
		{
			q[j * m + i] = input[i * w + j] >> 3;
			a[j * m + i] = q[j * m + i];
		}
	}

	for (k = 0; k < n; k++)
	{
		for (l = 0; l < k; l++)
		{
			nj = 0;
			for (i = 0; i < m; i++)
				nj = nj + q[l * m + i] * a[k * m + i];
			//	r[l * m + k] = nj>>10;
			tep = nj >> 10;
			for (i = 0; i < m; i++)
				q[k * m + i] = q[k * m + i] - ((short)(((tep)* q[l * m + i]) >> 10));
		}
		em = 0;
		for (i = 0; i < m; i++)
			em = em + q[l * m + i] * q[l * m + i];
		em = sqrt(em);
		//r[l * m + k] = em;
		for (i = 0; i < m; i++)
			q[k * m + i] = (q[k * m + i] << 10) / (em + 1);
	}
	for (j = 0; j < m; j++)
	{
		for (i = 0; i < w; i++)
		{
					if ((i == 0) || (i == 4) || (i == 6) || (i == 7) || (i == 13))output[j * w + i] = -1 * q[j * m + i];
				else 
					output[j * w + i] = 1 * q[i * m + j];
		}
	}

	//	memcpy(output, q, sizeof(int) * m * n);
	free(r);
	free(q);
	free(a);

}
